cvs: pearweb /public_html account-edit.php
| From: | Martin Jansen | Date: | Mon, 28 Jan 2002 17:29:41 +0000 |
| Subject: | cvs: pearweb /public_html account-edit.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2209@lists.php.net to get a copy of this message | ||
mj Mon Jan 28 12:29:41 2002 EDT
Modified files:
/pearweb/public_html account-edit.php
Log:
* Administrators and the user himself can edit account information.
Index: pearweb/public_html/account-edit.php
diff -u pearweb/public_html/account-edit.php:1.5 pearweb/public_html/account-edit.php:1.6
--- pearweb/public_html/account-edit.php:1.5 Thu Dec 27 22:51:33 2001
+++ pearweb/public_html/account-edit.php Mon Jan 28 12:29:40 2002
@@ -1,6 +1,6 @@
<?php
-auth_require(true);
+auth_require();
require_once "HTML/Form.php";
@@ -13,6 +13,15 @@
}
response_header("Edit Account: $handle");
+
+$admin = user::isAdmin($PHP_AUTH_USER);
+$user = ($PHP_AUTH_USER === $_GET['handle']);
+
+if (!$admin && !$user) {
+ PEAR::raiseError("Only the user himself or PEAR administrators can edit the account
information.");
+ response_footer();
+ exit();
+}
if (empty($handle) && !isset($HTTP_POST_VARS['command'])) {
PEAR::raiseError("No valid handle found!");