diff options
author | deva <deva> | 2010-02-28 10:23:01 +0000 |
---|---|---|
committer | deva <deva> | 2010-02-28 10:23:01 +0000 |
commit | 7891a55bf66fdf38ffa515dd8c00f740096a670a (patch) | |
tree | d1dd11cc8b8f313b1af48367deb8624739e8b603 | |
parent | 136e624d8c97f55e88d57ce05b3ac0e535afbf3e (diff) |
Remove old user/users admin files.
-rw-r--r-- | utils/admin_user.php | 32 | ||||
-rw-r--r-- | utils/admin_users.php | 203 |
2 files changed, 0 insertions, 235 deletions
diff --git a/utils/admin_user.php b/utils/admin_user.php deleted file mode 100644 index 42ed784..0000000 --- a/utils/admin_user.php +++ /dev/null @@ -1,32 +0,0 @@ -<h2>Password</h2> -<?php -include_once($UTIL_DIR."/user.php"); -include_once($UTIL_DIR."/convert.php"); - -if($task == "setpassword") { - $users = new Users($DATA_DIR . "/users.xml"); - $user = $users->findUser($HTTP_COOKIE_VARS["UserID"]); - $user->setPassword($oldpassword, $password1, $password2); - $users->add($user); // We need to update the user after changing the password! - $users->write(); -} -?> - -<div class="small_header">Change password</div> -<form method="post" action="?page=admin&module=user&task=setpassword"> - <p> - Old password: - <input type="password" name="oldpassword" style="width: 100px;" value=""/ - </p> - <p> - New password: - <input type="password" name="password1" style="width: 100px;" value=""/> - </p> - <p> - Confirm password: - <input type="password" name="password2" style="width: 100px;" value=""/> - </p> - <p> - <button type="submit">Change password</button> - </p> -</form> diff --git a/utils/admin_users.php b/utils/admin_users.php deleted file mode 100644 index c2e742f..0000000 --- a/utils/admin_users.php +++ /dev/null @@ -1,203 +0,0 @@ -<h2>Users</h2> -<?php -include_once($UTIL_DIR . "/user.php"); -$users = new Users($DATA_DIR. "/users.xml"); -?> - - -<div class="small_header">Add user</div> -<?php -if($task == "adduser") { - if($password1 == $password2) { - if(!$users->findUser($newuserid)) { - $user = new User($newuserid, - sha1(md5($newpassword1)), - $newmodule_users, - $newmodule_news, - $newmodule_events, - $newmodule_guestbook, - $newmodule_gallery, - $newmodule_user, - $newmodule_newsletter); - $users->add($user); - $users->write(); - echo "<p>User <em>" . $newuserid . "</em> added successfully.</p>\n"; - } else { - echo "<p>ERROR: User <em>" . $newuserid . "</em> already exists.</p>\n"; - } - } else { - echo "<p>ERROR: Passwords do not match.</p>\n"; - } -} -?> -<form method="post" action="?page=admin&module=users&task=adduser"> - <p> - UserID: <input name="newuserid" value="<?php echo $newuserid; ?>"/> - </p> - <p> - <input name="newmodule_users" - type="checkbox" <?php if($newmodule_users == "on") echo "checked"; ?>/> - Add/edit.delete users:<br/> - <input name="newmodule_user" - type="checkbox" <?php if($newmodule_user == "on") echo "checked"; ?>/> - Change password:<br/> - <input name="newmodule_news" - type="checkbox" <?php if($newmodule_news == "on") echo "checked"; ?>/> - Add news:<br/> - <input name="newmodule_events" - type="checkbox" <?php if($newmodule_events == "on") echo "checked"; ?>/> - Add events:<br/> - <input name="newmodule_gallery" - type="checkbox" <?php if($newmodule_gallery == "on") echo "checked"; ?>/> - Add images in gallery:<br/> - <input name="newmodule_newsletter" - type="checkbox" <?php if($newmodule_newsletter == "on") echo "checked"; ?>/> - Send newsletter:<br/> - <input name="newmodule_guestbook" - type="checkbox" <?php if($newmodule_guestbook == "on") echo "checked"; ?>/> - Modify guestbook - </p> - <p> - New password: - <input type="password" name="newpassword1" style="width: 100px;" value="<?php echo $newpassword1; ?>"/> - </p> - <p> - Confirm password: - <input type="password" name="newpassword2" style="width: 100px;" value="<?php echo $newpassword2; ?>"/> - </p> - <p> - <button type="submit">Add user</button> - </p> -</form> - -<div class="small_header">Edit user</div> -<?php -if($task == "updateuser") { - $user = $users->findUser($edituserid); - $user->users = $module_users; - $user->user = $module_user; - $user->news = $module_news; - $user->events = $module_events; - $user->gallery = $module_gallery; - $user->newsletter = $module_newsletter; - $user->guestbook = $module_guestbook; - if($password1 != "") { - if($password1 == $password2) { - $user->password = sha1(md5($password1)); - $users->add($user); - $users->write(); - echo "<p>User <em>" . $edituserid . "</em> successfully updated.</p>\n"; - } else { - echo "<p>ERROR: Passwords do not match</p>\n"; - $task = "edituser"; - } - } else { - $users->add($user); - $users->write(); - echo "<p>User <em>" . $edituserid . "</em> successfully updated. Password left untouched.</p>\n"; - } -} -?> -<?php -if($task == "edituser") { - $user = $users->findUser($edituserid); -?> -<form method="post" action="?page=admin&module=users&task=updateuser"> - <p> - UserID: <input name="edituserid" readonly value="<?php echo $user->userid; ?>"/> - </p> - <p> - <input name="module_users" - type="checkbox" <?php if($user->users == "on") echo "checked"; ?>/> - Add/edit.delete users:<br/> - <input name="module_user" - type="checkbox" <?php if($user->user == "on") echo "checked"; ?>/> - Change password:<br/> - <input name="module_news" - type="checkbox" <?php if($user->news == "on") echo "checked"; ?>/> - Add news:<br/> - <input name="module_events" - type="checkbox" <?php if($user->events == "on") echo "checked"; ?>/> - Add events:<br/> - <input name="module_gallery" - type="checkbox" <?php if($user->gallery == "on") echo "checked"; ?>/> - Add images in gallery:<br/> - <input name="module_newsletter" - type="checkbox" <?php if($user->newsletter == "on") echo "checked"; ?>/> - Send newsletter:<br/> - <input name="module_guestbook" - type="checkbox" <?php if($user->guestbook == "on") echo "checked"; ?>/> - Modify guestbook - </p> - <p> - New password: - <input type="password" name="password1" style="width: 100px;" value=""/> - </p> - <p> - Confirm password: - <input type="password" name="password2" style="width: 100px;" value=""/> - </p> - <p> - <button type="submit">Submit changes</button> - </p> -</form> -<?php -} -?> -<form method="post" action="?page=admin&module=users&task=edituser"> - <p> - Select the user you want to edit:<br/> - <select name="edituserid"> -<?php -$uids = $users->useridList(); -foreach($uids as $uid) { -?> - <option value="<?php echo $uid;?>"><?php echo $uid;?></option> -<?php -} -?> - </select> - <button type="submit">Edit</button> - </p> -</form> - -<div class="small_header">Delete user</div> -<?php -if($task == "deleteconfirm") { -?> -Are you sure you want to delete the <em><?php echo $deleteuserid; ?></em> user?<br/> -<form method="post" action="?page=admin&module=users&task=delete"> - <input name="deleteuserid" type="hidden" value="<?php echo $deleteuserid ?>"/> - <button type="submit">Yes</button> -</form> -<form method="post" action="?page=admin&module=users"> - <input name="deleteuserid" type="hidden" value="<?php echo $deleteuderid; ?>"/> - <button type="submit">No</button> -</form> -<?php -} -?> - -<?php -if($task == "delete") { - if($users->deleteUser($deleteuserid)) { - echo "<p>User <em>".$deleteuserid."</em> deleted successfully.</p>\n"; - } -} -?> -<form method="post" action="?page=admin&module=users&task=deleteconfirm"> - <p> - Select the user you want to delete:<br/> - <select name="deleteuserid"> -<?php -$uids = $users->useridList(); -foreach($uids as $uid) { -?> - <option value="<?php echo $uid;?>"><?php echo $uid;?></option> -<?php -} -?> - </select> - <button type="submit">Delete</button> - </p> -</form> |