[CS-Project-svn_notify] SF.net SVN: cs-project: [799] trunk/1.2
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-02-07 07:00:22
|
Revision: 799 http://cs-project.svn.sourceforge.net/cs-project/?rev=799&view=rev Author: crazedsanity Date: 2008-02-06 23:00:16 -0800 (Wed, 06 Feb 2008) Log Message: ----------- Move admin stuff to sub-section of settings (code cleaning still needed). Modified Paths: -------------- trunk/1.2/includes/content/settings.inc trunk/1.2/templates/content/settings/index.content.tmpl Added Paths: ----------- trunk/1.2/templates/content/settings/admin.content.tmpl Modified: trunk/1.2/includes/content/settings.inc =================================================================== --- trunk/1.2/includes/content/settings.inc 2008-02-07 06:24:26 UTC (rev 798) +++ trunk/1.2/includes/content/settings.inc 2008-02-07 07:00:16 UTC (rev 799) @@ -171,30 +171,40 @@ $page->add_template_var('pref_row', $prefRow); } - if($user->is_admin() == 1) { - //add the template to show various admin stuff. - $page->add_template_var("admin_section", $page->templateRows['admin_section']); - - //create an object with administrative capabilities. - $adminUserClass = new adminUserClass($page->db); - - //build the list of available groups. - $myGroups = $adminUserClass->get_groups(TRUE); - $page->add_template_var("addUser_gruppe", array_as_option_list($myGroups, $_SESSION['login_group_id'])); - - //Group administration. - { - $showGroup = $page->ui->get_cache("settings/showGroup"); - if(is_numeric($_GET['showGroup'])) { - $showGroup = $_GET['showGroup']; + if(count($page->ftsSections) == 3 && $page->ftsSections[2] == 'admin') { + if($user->is_admin() == 1) { + //add the template to show various admin stuff. + $page->add_template_var("admin_section", $page->templateRows['admin_section']); + + //create an object with administrative capabilities. + $adminUserClass = new adminUserClass($page->db); + + //build the list of available groups. + $myGroups = $adminUserClass->get_groups(TRUE); + $page->add_template_var("addUser_gruppe", array_as_option_list($myGroups, $_SESSION['login_group_id'])); + + //Group administration. + { + $showGroup = $page->ui->get_cache("settings/showGroup"); + if(is_numeric($_GET['showGroup'])) { + $showGroup = $_GET['showGroup']; + } + elseif(!is_numeric($showGroup)) { + $showGroup = $_SESSION['login_group_id']; + } + $page->ui->set_cache("settings/showGroup", $showGroup); + regenerate_group_lists($showGroup); + display_current_leader($showGroup); } - elseif(!is_numeric($showGroup)) { - $showGroup = $_SESSION['login_group_id']; - } - $page->ui->set_cache("settings/showGroup", $showGroup); - regenerate_group_lists($showGroup); - display_current_leader($showGroup); } + else { + $msg = array( + 'title' => "Insufficient Privileges ", + 'message' => "Administrative privileges are required to view this section.", + 'type' => "fatal" + ); + $page->set_message_wrapper($msg); + } } } Copied: trunk/1.2/templates/content/settings/admin.content.tmpl (from rev 789, trunk/1.2/templates/content/settings/index.content.tmpl) =================================================================== --- trunk/1.2/templates/content/settings/admin.content.tmpl (rev 0) +++ trunk/1.2/templates/content/settings/admin.content.tmpl 2008-02-07 07:00:16 UTC (rev 799) @@ -0,0 +1,117 @@ + +<h2><font color="red">Administrative Settings</font></h2> + + +<a name="group"> +<table border=1 cellpadding=3 cellspacing=0> + <tr> + <th colspan="3"><a href="#groupManagement"></a>Group Management</th> + </tr> + <tr> + <th>Select a group</th> + + <th>Current Members</th> + + <th>Non-Members</th> + </tr> + <tr> + <td> + <b>Change current group:</b><BR> + <SELECT> +<!-- BEGIN show_group_list --> + <option onClick="javascript:void(xajax_ajax__change_current_group(%%group_id%%))" %%selectedString%%>%%display%% (%%short_name%%)</option> +<!-- END show_group_list --> + </SELECT><BR><BR><hr> + <div id="currentGroupLeader"> +<!-- BEGIN currentGroupLeaderBox --> + <b>Change Leader </b>({currentGroupLeader})<b> to:</b> + <input name="changeLeader[groupId]" type="HIDDEN" value="{groupId}"> + <SELECT name="changeLeader[newLeader]"> + {changeGroupLeader_list} + </SELECT><BR> +<!-- END currentGroupLeaderBox --> + </div> + <input type="submit" value="Change Leader" onClick="this.form.action.value='changeLeader'"> + </td> + + <td> + <div id="group_nonMembers"> + <!-- BEGIN group_nonMembers --> + <table> +<!-- BEGIN show_group_list__removeUser --> + <tr> + <td>(<b><a href="javascript:void(xajax_ajax__group_user(%%group_id%%, %%uid%%, 'remove'));">Remove</a></b>) %%username%%</td> + </tr> +<!-- END show_group_list__removeUser --> +<!-- BEGIN show_group_list__noRemoveUser --> + <tr> + <td><b><font color="red">No users to remove</font></b></td> + </tr> +<!-- END show_group_list__noRemoveUser --> + </table> + <!-- END group_nonMembers --> + </div> + </td> + + <td> + <div id="group_currentMembers"> + <!-- BEGIN group_currentMembers --> + <table> +<!-- BEGIN show_group_list__selectUser --> + <tr> + <td>(<b><a href="javascript:void(xajax_ajax__group_user(%%group_id%%, %%uid%%, 'add'));">Add</a></b>) %%username%%</td> + </tr> +<!-- END show_group_list__selectUser --> +<!-- BEGIN show_group_list__noUser --> + <tr> + <td><b><font color="red">No users to add</font></b></td> + </tr> +<!-- END show_group_list__noUser --> + </table> + <!-- END group_currentMembers --> + </div> + </td> + </tr> +</table> + + +<form method="POST"> + +<table border=1 cellpadding=3 cellspacing=0> + <tr> + <th colspan="2"><a href="#createUser"></a>Create User:</th> + </tr> + <tr> + <td>Username: </td> + <td><input name="addUser[username]" type="text"></td> + </tr> + <tr> + <td>Password: </td> + <td><input name="addUser[password]" type="text"></td> + </tr> + <tr> + <td>First Name: </td> + <td><input name="addUser[fname]" type="text"></td> + </tr> + <tr> + <td>Last Name: </td> + <td><input name="addUser[lname]" type="text"></td> + </tr> + <tr> + <td>Company: </td> + <td><input name="addUser[company]" type="text"></td> + </tr> + <tr> + <td>Email: </td> + <td><input name="addUser[email]" type="text"></td> + </tr> + <tr> + <td>Default Group: </td> + <td><SELECT name="addUser[group_id]">{addUser_gruppe}</SELECT></td> + </tr> + <tr> + <td colspan="2"><input type="submit" value="Add User" OnClick="javascript:this.form.action.value='addUser';"></td> + </tr> +</table> +<input type="HIDDEN" name="action" value="Fix_JAVASCRIPT"> +</form> Modified: trunk/1.2/templates/content/settings/index.content.tmpl =================================================================== --- trunk/1.2/templates/content/settings/index.content.tmpl 2008-02-07 06:24:26 UTC (rev 798) +++ trunk/1.2/templates/content/settings/index.content.tmpl 2008-02-07 07:00:16 UTC (rev 799) @@ -80,126 +80,3 @@ <input type="hidden" name="action" value="set_preference"> </form> - - - - - -<!-- BEGIN admin_section --> -<form method="POST"> -<hr> -<h2><font color="red">Administrative Settings</font></h2> - - -<a name="group"> -<table border=1 cellpadding=3 cellspacing=0> - <tr> - <th colspan="3"><a href="#groupManagement"></a>Group Management</th> - </tr> - <tr> - <th>Select a group</th> - - <th>Current Members</th> - - <th>Non-Members</th> - </tr> - <tr> - <td> - <b>Change current group:</b><BR> - <SELECT> -<!-- BEGIN show_group_list --> - <option onClick="javascript:void(xajax_ajax__change_current_group(%%group_id%%))" %%selectedString%%>%%display%% (%%short_name%%)</option> -<!-- END show_group_list --> - </SELECT><BR><BR><hr> - <div id="currentGroupLeader"> -<!-- BEGIN currentGroupLeaderBox --> - <b>Change Leader </b>({currentGroupLeader})<b> to:</b> - <input name="changeLeader[groupId]" type="HIDDEN" value="{groupId}"> - <SELECT name="changeLeader[newLeader]"> - {changeGroupLeader_list} - </SELECT><BR> -<!-- END currentGroupLeaderBox --> - </div> - <input type="submit" value="Change Leader" onClick="this.form.action.value='changeLeader'"> - </td> - - <td> - <div id="group_nonMembers"> - <!-- BEGIN group_nonMembers --> - <table> -<!-- BEGIN show_group_list__removeUser --> - <tr> - <td>(<b><a href="javascript:void(xajax_ajax__group_user(%%group_id%%, %%uid%%, 'remove'));">Remove</a></b>) %%username%%</td> - </tr> -<!-- END show_group_list__removeUser --> -<!-- BEGIN show_group_list__noRemoveUser --> - <tr> - <td><b><font color="red">No users to remove</font></b></td> - </tr> -<!-- END show_group_list__noRemoveUser --> - </table> - <!-- END group_nonMembers --> - </div> - </td> - - <td> - <div id="group_currentMembers"> - <!-- BEGIN group_currentMembers --> - <table> -<!-- BEGIN show_group_list__selectUser --> - <tr> - <td>(<b><a href="javascript:void(xajax_ajax__group_user(%%group_id%%, %%uid%%, 'add'));">Add</a></b>) %%username%%</td> - </tr> -<!-- END show_group_list__selectUser --> -<!-- BEGIN show_group_list__noUser --> - <tr> - <td><b><font color="red">No users to add</font></b></td> - </tr> -<!-- END show_group_list__noUser --> - </table> - <!-- END group_currentMembers --> - </div> - </td> - </tr> -</table> - -<table border=1 cellpadding=3 cellspacing=0> - <tr> - <th colspan="2"><a href="#createUser"></a>Create User:</th> - </tr> - <tr> - <td>Username: </td> - <td><input name="addUser[username]" type="text"></td> - </tr> - <tr> - <td>Password: </td> - <td><input name="addUser[password]" type="text"></td> - </tr> - <tr> - <td>First Name: </td> - <td><input name="addUser[fname]" type="text"></td> - </tr> - <tr> - <td>Last Name: </td> - <td><input name="addUser[lname]" type="text"></td> - </tr> - <tr> - <td>Company: </td> - <td><input name="addUser[company]" type="text"></td> - </tr> - <tr> - <td>Email: </td> - <td><input name="addUser[email]" type="text"></td> - </tr> - <tr> - <td>Default Group: </td> - <td><SELECT name="addUser[group_id]">{addUser_gruppe}</SELECT></td> - </tr> - <tr> - <td colspan="2"><input type="submit" value="Add User" OnClick="javascript:this.form.action.value='addUser';"></td> - </tr> -</table> -<input type="HIDDEN" name="action" value="Fix_JAVASCRIPT"> -</form> -<!-- END admin_section --> - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |