Beispiel #1
0
    $adduserkey = urlTitle($_POST[edituser][name]);
    if (!array_key_exists($adduserkey, $currentusers)) {
        $statusmessage = "User &quot;{$adduserkey}&quot; does not exist.<br /><a href=\"javascript:history.go(-1);\">How about choosing another name?</a>";
    } else {
        $olduser = $currentusers[$adduserkey];
        # has the password changed?
        if ($_POST[edituser][password] != "") {
            $_POST[edituser][password] = md5($_POST[edituser][password]);
            $_POST[edituser][password] = sha1($_POST[edituser][password] . UNIQUE);
            $passchange = "y";
        } else {
            $_POST[edituser][password] = $olduser[password];
        }
        $data = array("registered" => stripslashes($olduser[registered]), "nickname" => stripslashes($_POST[edituser][nickname]), "password" => stripslashes($_POST[edituser][password]), "email" => stripslashes($_POST[edituser][email]), "url" => stripslashes($_POST[edituser][url]), "profile" => stripslashes($_POST[edituser][profile]), "level" => stripslashes($_POST[edituser][level]));
        $dataclass->settings['users'][$adduserkey] = $data;
        $dataclass->save();
        # Give the user a status message
        $statusmessage = "User &quot;{$adduserkey}&quot; edited";
        if ($passchange == "y") {
            $statusmessage = "User &quot;{$adduserkey}&quot; edited - password changed";
        }
    }
}
if ($_GET[edit] && !$_POST[edituser] && !$_GET[action]) {
    #
    #	Edit a user
    #
    $now = time();
    $dataclass = new SettingsStorage('settings');
    $currentusers = $dataclass->settings['users'];
    $usertoedit = urlTitle($_GET[edit]);
					<p>';
    $main_content .= makeDropDown($alltemplates, "addcat[template]", "");
    $main_content .= ' <label>' . i18n("categories_defaulttpl") . '</label>
					</p>
					<p>
						<input class="add" type="submit" value="' . i18n("categories_add") . '" />
					</p>
			</fieldset>
		</form>	
	</div>
	</div>';
}
if ($_POST[addcat]) {
    #
    #	Add a new category (Routine)
    #
    $now = time();
    # Remove unwanted stuff!
    $_POST[addcat][name] = sanitize_variables($_POST[addcat][name]);
    $_POST[addcat][template] = sanitize_variables($_POST[addcat][template]);
    $data = array("name" => stripslashes($_POST[addcat][name]), "template" => stripslashes($_POST[addcat][template]));
    $settingclass->settings['categories'][] = $data;
    $settingclass->save();
    # Give the user a status message
    $statusmessage = "Category &quot;{$data['name']}&quot; added";
}
#
#	Delete a category (Routine)
#
if ($_GET[action] && $_GET[catid]) {
}