admlock.php

来自「eGroupWare is a multi-user, web-based gr」· PHP 代码 · 共 79 行

PHP
79
字号
<?php/**************************************************************************** copyright            : (C) 2001-2003 Advanced Internet Designs Inc.* email                : forum@prohost.org* $Id: admlock.php,v 1.3 2004/07/08 14:25:47 iliaa Exp $** This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or * (at your option) any later version.***************************************************************************/	require('./GLOBALS.php'); fud_egw();	fud_use('adm.inc', true);	fud_use('glob.inc', true);function chmoddir($dirn, $dirp, $filep, $rec=false){	@chmod($dirn, $dirp);	if (!($d = opendir($dirn))) {		echo 'ERROR: Unable to open "'.$dirn.'" directory<br>';		return;	}	while ($f = readdir($d)) {		if ($f == '.' || $f == '..') continue;		$path = $dirn . '/' . $f;		if (@is_file($path) && !@chmod($path, $filep)) {			echo 'ERROR: couldn\'t chmod "'.$path.'"<br>';		} else if (@is_dir($path) && $rec === true) {			chmoddir($path, $dirp, $filep, true);		}	}	closedir($d);}	if (isset($_POST['usr_passwd'], $_POST['usr_login']) && q_singleval("SELECT id FROM ".$DBHOST_TBL_PREFIX."users WHERE login='".addslashes($_POST['usr_login'])."' AND passwd='".md5($_POST['usr_passwd'])."' AND (users_opt & 1048576) > 0")) {		$FUD_OPT_2 |= 8388608;		if (isset($_POST['btn_unlock'])) {			$dirperms = 0777;			$fileperms = 0666;			@unlink($ERROR_PATH.'FILE_LOCK');			$FUD_OPT_2 ^= 8388608;		} else {			if (!strncmp(PHP_SAPI, 'apache', 6)) {				$dirperms = 0700;				$fileperms = 0600;			} else {				$dirperms = 0711;				$fileperms = 0644;			}		}		chmoddir(realpath($WWW_ROOT_DISK), $dirperms, $fileperms, true);		chmoddir(realpath($DATA_DIR), $dirperms, $fileperms, true);		change_global_settings(array('FUD_OPT_2' => $FUD_OPT_2));	}	$status = ($FUD_OPT_2 & 8388608 ? 'LOCKED' : 'UNLOCKED');	require($WWW_ROOT_DISK . 'adm/admpanel.php');?><div align="center" style="font-size: xx-large; color: #ff0000;">	The forum's files appear to be: <b><?php echo $status; ?></b>.<br>	<font size="-1">If this test claims that the forum is unlocked, but you still cannot modify your files click on the "Unlock Files" button.</font><br>	For security reasons remember to lock your forum's files after you are done editing them.</div><form method="post"><table border=0 cellspacing=0 cellpadding=3><tr><td>Login:</td><td><input type="text" name="usr_login" value="<?php echo $usr->alias; ?>"></td></tr><tr><td>Password:</td><td><input type="password" name="usr_passwd"></td></tr><tr><td colspan=2 algin=middle>	<input type="submit" name="btn_lock" value="Lock Files">	<input type="submit" name="btn_unlock" value="Unlock Files"></td></tr></table><?php echo _hs; ?></form><?php require($WWW_ROOT_DISK . 'adm/admclose.php'); ?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?