Changeset 1533 for branches/multiuser

Show
Ignore:
Timestamp:
08/11/06 09:23:07 (2 years ago)
Author:
mdodoo
Message:

Beginnings of a user management page in the administrative section. Does not allow for anything cool yet, though.

Location:
branches/multiuser
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/multiuser/admin/index.php

    r1530 r1533  
    4343require_once('themes.php'); 
    4444require_once('tags.php'); 
     45require_once('users.php'); 
    4546require_once('../cls/wrappers/toolkit.php'); 
    4647 
     
    7071define ('CST_ADMIN_DOMAIN_THEME_OPTIONS','theme_options'); 
    7172define ('CST_ADMIN_DOMAIN_TAGS','tags'); 
     73define('CST_ADMIN_DOMAIN_USERS','users'); 
    7274// OPML import target 
    7375define ('CST_ADMIN_OPML_IMPORT_WIPE',1); 
     
    8991        } 
    9092        set_admin_pass($admin_uname,$admin_pass); 
    91     } else { 
    92         rss_login_form(); 
    93       exit(); 
     93    } else if(!rss_user_check_user_level(RSS_USER_LEVEL_BASIC)){ 
     94            rss_login_form(); 
     95            exit(); 
    9496    } 
    9597} 
    9698 
    9799admin_header(); 
    98 admin_main($auth); 
     100admin_main(rss_user_level()); 
    99101admin_footer(); 
    100102 
     
    139141                $show = theme_options_admin(); 
    140142                break; 
     143            case CST_ADMIN_DOMAIN_USERS: 
     144                $show = users_admin(); 
     145                break; 
    141146            default: 
    142147                break; 
     
    187192                theme_options(); 
    188193                break; 
     194            case CST_ADMIN_DOMAIN_USERS: 
     195                users(); 
     196                break; 
    189197            default: 
    190198            } 
     
    225233                 array (CST_ADMIN_DOMAIN_FOLDER, LBL_ADMIN_DOMAIN_FOLDER_LBL), 
    226234                 array (CST_ADMIN_DOMAIN_OPML, LBL_ADMIN_DOMAIN_LBL_OPML_LBL), 
    227                  array (CST_ADMIN_DOMAIN_TAGS, LBL_TAG_TAGS)) as $item) { 
     235                 array (CST_ADMIN_DOMAIN_TAGS, LBL_TAG_TAGS), 
     236                 array (CST_ADMIN_DOMAIN_USERS, LBL_ADMIN_USERS)) as $item) { 
    228237 
    229238        $link = "index.php?view=".$item[0]; 
  • branches/multiuser/admin/users.php

    r1441 r1533  
    9797    ."<legend>" . LBL_ADMIN_LOGIN . "</legend>\n" 
    9898    ."<p><label style=\"display:block\" for=\"username\">".LBL_USERNAME.":</label>\n" 
    99     ."<input type=\"text\" id=\"username\" name=\"username\" /></p>\n" 
     99    ."<input type=\"text\" id=\"username\" name=\"username\" value=\"$uname\" /></p>\n" 
    100100    ."<p><label style=\"display:block\" for=\"password\">".LBL_PASSWORD.":</label>\n" 
    101     ."<input type=\"password\" id=\"password\" name=\"password\" /></p>\n" 
     101    ."<input type=\"password\" id=\"password\" name=\"password\" value=\"$pass\" /></p>\n" 
    102102    ."<p id=\"admin_login_submit\"><input type=\"submit\" value=\"".LBL_LOG_IN."\" /></p>\n" 
    103103    ."<span style=\"display:inline;\" id=\"admin_login_result\"></span>\n" 
     
    110110} 
    111111 
     112 
     113function users(){ 
     114    echo "<h2 class=\"trigger\">".LBL_ADMIN_USERS."</h2>\n"; 
     115    if(rss_user_check_user_level(RSS_USER_LEVEL_ADMIN)){ 
     116        // TODO: we need more labels here 
     117        echo "<table>\n" 
     118        ."<tr>\n" 
     119        ."\t<th>" . LBL_USERNAME . "</th>\n" 
     120        ."\t<th></th>\n" 
     121        ."\t<th></th>\n" 
     122        ."\t<th></th>\n" 
     123        ."</tr>\n"; 
     124        $sql = "select uid, uname, realname, ulevel, lastlogin from " .getTable("users"); 
     125        $res = rss_query($sql); 
     126        $cntr = 0; 
     127        while (list($uid, $uname, $realname, $ulevel, $lastlogin) = rss_fetch_row($res)){ 
     128            $class_ = (($cntr++ % 2 == 0)?"even":"odd"); 
     129            echo "<tr class=\"$class_\" id=\"u$uid\">\n" 
     130            ."\t<td>$uname</td>\n" 
     131            ."\t<td>$realname</td>\n" 
     132            ."\t<td>$ulevel</td>\n" 
     133            ."\t<td>$lastlogin</td>\n" 
     134            ."</tr>\n"; 
     135        } 
     136        echo "</table>\n"; 
     137        // TODO: add new user dialog 
     138    }else if($auth_level == RSS_USER_LEVEL_BASIC){ 
     139        // TODO: allow user to edit own profile 
     140    }    
     141} 
     142 
     143function users_admin(){ 
     144// perform actions 
     145} 
    112146?> 
  • branches/multiuser/intl/en.php

    r1502 r1533  
    305305define ('LBL_FLAG','Flagged'); 
    306306 
     307define('LBL_ADMIN_USERS','Users'); 
    307308?>