From 35562f519abaece77746381b73dea0fa0d13ed3e Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 27 Feb 2010 13:47:07 +0000 Subject: Lots of work done on the admin system. New layout. Remove all use of graphics. Add access control on module basis. --- utils/admin.php | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- utils/forms.php | 8 +-- utils/user.php | 53 +++++++------------ 3 files changed, 172 insertions(+), 47 deletions(-) (limited to 'utils') diff --git a/utils/admin.php b/utils/admin.php index d0303c9..ab22a9a 100644 --- a/utils/admin.php +++ b/utils/admin.php @@ -1,5 +1,7 @@ -
-
Admin
+ +
+ Admin + findUser($UID); ?> - - +Logout + diff --git a/utils/forms.php b/utils/forms.php index 5694c03..45939e7 100644 --- a/utils/forms.php +++ b/utils/forms.php @@ -338,12 +338,12 @@ class ListEditor { } } $str .= $indent . "
\n"; - $str .= $indent . "
\n"; - $str .= $indent . "
\n"; + $str .= $indent . "
/\

\n"; + $str .= $indent . "
\/

\n"; $str .= $this->namewidget->render($indent); $str .= $this->valuewidget->render($indent); - $str .= "
\n"; - $str .= $indent . "
\n"; + $str .= "
+

\n"; + $str .= $indent . "
-

\n"; return $str; } diff --git a/utils/user.php b/utils/user.php index 508f83d..f189987 100644 --- a/utils/user.php +++ b/utils/user.php @@ -1,18 +1,11 @@ -password == sha1(md5($password)); @@ -35,18 +28,22 @@ class User { return 0; } - public function User($userid, $password, $users, $news, $events, $guestbook, $gallery, $user, $newsletter, $pressrelease) + public function checkModule($module) + { + if($this->modules == "*") return true; + if($this->modules == "") return false; + + $modulelist = explode(" ", $this->modules); + return in_array($module, $modulelist); + + return true; + } + + public function User($userid, $password, $modules) { $this->userid = $userid; $this->password = $password; - $this->users = $users; - $this->news = $news; - $this->events = $events; - $this->guestbook = $guestbook; - $this->gallery = $gallery; - $this->user = $user; - $this->newsletter = $newsletter; - $this->pressrelease = $pressrelease; + $this->modules = $modules; } } @@ -70,14 +67,7 @@ class Users { fwrite($fp, " userid, ENT_QUOTES, "UTF-8") . "\"\n"); fwrite($fp, " password=\"" . $user->password . "\"\n"); - fwrite($fp, " users=\"" . $user->users . "\"\n"); - fwrite($fp, " news=\"" . $user->news . "\"\n"); - fwrite($fp, " events=\"" . $user->events . "\"\n"); - fwrite($fp, " guestbook=\"" . $user->guestbook . "\"\n"); - fwrite($fp, " gallery=\"" . $user->gallery . "\"\n"); - fwrite($fp, " user=\"" . $user->user . "\"\n"); - fwrite($fp, " newsletter=\"" . $user->newsletter . "\"\n"); - fwrite($fp, " pressrelease=\"" . $user->pressrelease . "\">\n"); + fwrite($fp, " modules=\"" . $user->modules . "\">\n"); fwrite($fp, " \n"); } fwrite($fp, "\n"); @@ -127,15 +117,8 @@ class Users { foreach ($params as $param) { $user = new User($param->getAttribute('userid'), - $param->getAttribute('password'), - $param->getAttribute('users'), - $param->getAttribute('news'), - $param->getAttribute('events'), - $param->getAttribute('guestbook'), - $param->getAttribute('gallery'), - $param->getAttribute('user'), - $param->getAttribute('newsletter'), - $param->getAttribute('pressrelease')); + $param->getAttribute('password'), + $param->getAttribute('modules')); $this->add($user); } -- cgit v1.2.3