- fixed a bunch of admin privileges.
authorjoel kronenberg <joel.kronenberg@utoronto.ca>
Thu, 8 Dec 2005 21:04:47 +0000 (21:04 -0000)
committerjoel kronenberg <joel.kronenberg@utoronto.ca>
Thu, 8 Dec 2005 21:04:47 +0000 (21:04 -0000)
- moved sys prefs to its own page
- added Manage style navigation to the Home page

docs/admin/index.php
docs/include/lib/menu_pages.php
docs/login.php
docs/mods/_core/languages/module.php
docs/mods/_core/themes/module.php
docs/mods/_core/users/module.php
docs/mods/_standard/google_search/module.php
docs/mods/_standard/rss_feeds/module.php

index 3bf4a10..2c1d5e7 100644 (file)
@@ -14,7 +14,7 @@
 
 define('AT_INCLUDE_PATH', '../include/');
 require(AT_INCLUDE_PATH.'vitals.inc.php');
-admin_authenticate(AT_ADMIN_PRIV_ADMIN);
+admin_authenticate();
 
 if (defined('AT_DEVEL_TRANSLATE') && AT_DEVEL_TRANSLATE) { 
        $msg->addWarning('TRANSLATE_ON');       
@@ -28,14 +28,19 @@ if ($_config['check_version']) {
                $msg->printFeedbacks('ATUTOR_UPDATE_AVAILABLE');
        }
 }
-if ($_config['allow_instructor_requests']): ?>
-<?php
-       $sql    = "SELECT COUNT(*) AS cnt FROM ".TABLE_PREFIX."instructor_approvals";
-       $result = mysql_query($sql, $db);
-       $row    = mysql_fetch_assoc($result);
 ?>
-       <form method="get" action="admin/instructor_requests.php">
-               <div class="input-form">
+
+<div style="width: 40%; float: right; padding-top: 4px; padding-left: 10px;">
+
+       <?php if ($_config['allow_instructor_requests'] && admin_authenticate(AT_ADMIN_PRIV_USERS, AT_PRIV_RETURN)): ?> 
+               <?php
+                       $sql    = "SELECT COUNT(*) AS cnt FROM ".TABLE_PREFIX."instructor_approvals";
+                       $result = mysql_query($sql, $db);
+                       $row    = mysql_fetch_assoc($result);
+               ?>
+
+       <div class="input-form" style="width: 98%;">
+               <form method="get" action="admin/instructor_requests.php">
                        <div class="row">
                                <h3><?php echo _AT('instructor_requests'); ?></h3>
                                <p><?php echo _AT('instructor_requests_text', $row['cnt']); ?></strong></p>
@@ -44,35 +49,61 @@ if ($_config['allow_instructor_requests']): ?>
                        <div class="row buttons">
                                <input type="submit" name="submit" value="<?php echo _AT('view'); ?>" />
                        </div>
-               </div>
-       </form>
-<?php endif; ?>
-
-<form method="get" action="http://atutor.ca/check_atutor_version.php" target="_blank">
-       <input type="hidden" name="v" value="<?php echo urlencode(VERSION); ?>" />
-       <div class="input-form">
-               <div class="row">
-                       <h3><?php echo _AT('atutor_version'); ?></h3>
-                       <p><?php echo _AT('atutor_version_text', VERSION); ?></strong></p>
-               </div>
-
-               <div class="row buttons">
-                       <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" />
-               </div>
+               </form>
        </div>
-</form>
-
-<form method="get" action="<?php echo $_base_href; ?>admin/fix_content.php">
-       <div class="input-form">
-               <div class="row">
-                       <h3><?php echo _AT('fix_content_ordering'); ?></h3>
-                       <p><?php echo _AT('fix_content_ordering_text'); ?></p>
-               </div>
-
-               <div class="row buttons">
-                       <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" />
-               </div>
+
+       <?php endif; ?>
+
+       <div class="input-form" style="width: 98%;">
+               <form method="get" action="http://atutor.ca/check_atutor_version.php" target="_blank">
+               <input type="hidden" name="v" value="<?php echo urlencode(VERSION); ?>" />
+                       <div class="row">
+                               <h3><?php echo _AT('atutor_version'); ?></h3>
+                               <p><?php echo _AT('atutor_version_text', VERSION); ?></strong></p>
+                       </div>
+
+                       <div class="row buttons">
+                               <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" />
+                       </div>
+               </form>
        </div>
-</form>
 
+       <?php if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, AT_PRIV_RETURN)): ?>
+       <div class="input-form" style="width: 98%;">
+               <form method="get" action="<?php echo $_base_href; ?>admin/fix_content.php">
+                       <div class="row">
+                               <h3><?php echo _AT('fix_content_ordering'); ?></h3>
+                               <p><?php echo _AT('fix_content_ordering_text'); ?></p>
+                       </div>
+
+                       <div class="row buttons">
+                               <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" />
+                       </div>
+               </form>
+       </div>
+       <?php endif; ?>
+</div>
+
+<div style="width: 60%;">
+       <?php
+       $path_length = strlen($_base_path);
+
+       echo '<ol id="tools" style="margin-right: 0px;">';
+       foreach ($_top_level_pages as $page_info) {
+               echo '<li class="top-tool"><a href="' . $page_info['url'] . '">' . $page_info['title'] . '</a>';
+
+               $page_info['url'] = substr($page_info['url'], $path_length);
+
+               if ($_pages[$page_info['url']]['children']) {
+                       echo '<ul class="child-top-tool">';
+                       foreach ($_pages[$page_info['url']]['children'] as $child) {
+                               echo '<li class="child-tool"><a href="'.$child.'">'._AT($_pages[$child]['title_var']).'</li>';
+                       }
+                       echo '</ul>';
+               }
+               echo '</li>';
+       }
+       echo '</ol>';
+?>
+</div>
 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file
index 5a10143..edb86d6 100644 (file)
@@ -54,28 +54,27 @@ if ($_SESSION['course_id'] > 0) {
 } else if ($_SESSION['course_id'] == -1) {
        /* admin pages */
 
-               $_pages['admin/index.php']['title_var'] = 'configuration';
-               $_pages['admin/index.php']['parent']    = AT_NAV_ADMIN;
-               $_pages['admin/index.php']['guide']     = 'admin/?p=2.0.configuration.php';
-               if (isset($_pages['admin/index.php']['children'])) {
-                       array_unshift($_pages['admin/index.php']['children'], 'admin/admins/my_edit.php', 'admin/config_edit.php', 'admin/error_logging.php');
-               } else {
-                       $_pages['admin/index.php']['children'] = array('admin/admins/my_edit.php', 'admin/config_edit.php', 'admin/error_logging.php');
-               }
+       $_pages['admin/index.php']['title_var'] = 'home';
+       $_pages['admin/index.php']['parent']    = AT_NAV_ADMIN;
+       $_pages['admin/index.php']['guide']     = 'admin/?p=2.0.configuration.php';
+       $_pages['admin/index.php']['children'] = array('admin/admins/my_edit.php');
+
+       $_pages['admin/admins/my_edit.php']['title_var'] = 'my_account';
+       $_pages['admin/admins/my_edit.php']['parent']    = 'admin/index.php';
+       $_pages['admin/admins/my_edit.php']['guide']     = 'admin/?p=2.1.my_account.php';
 
-               $_pages['admin/admins/my_edit.php']['title_var'] = 'my_account';
-               $_pages['admin/admins/my_edit.php']['parent']    = 'admin/index.php';
-               $_pages['admin/admins/my_edit.php']['guide']     = 'admin/?p=2.1.my_account.php';
+       if (admin_authenticate(AT_ADMIN_PRIV_USERS, AT_PRIV_RETURN)) {
+               $_pages[AT_NAV_ADMIN][] = 'admin/config_edit.php';
 
                $_pages['admin/config_edit.php']['title_var'] = 'system_preferences';
-               $_pages['admin/config_edit.php']['parent']    = 'admin/index.php';
+               $_pages['admin/config_edit.php']['parent']    = AT_NAV_ADMIN;
                $_pages['admin/config_edit.php']['guide']     = 'admin/?p=2.2.system_preferences.php';
-
+       }
                $_pages['admin/fix_content.php']['title_var'] = 'fix_content_ordering';
                $_pages['admin/fix_content.php']['parent']    = 'admin/index.php';
 
                $_pages['admin/error_logging.php']['title_var'] = 'error_logging';
-               $_pages['admin/error_logging.php']['parent']    = 'admin/index.php';
+               $_pages['admin/error_logging.php']['parent']    = 'admin/config_edit.php';
                $_pages['admin/error_logging.php']['guide']     = 'admin/?p=2.5.error_logging.php';
                $_pages['admin/error_logging.php']['children']  = array('admin/error_logging_bundle.php', 'admin/error_logging_reset.php');
 
@@ -180,18 +179,6 @@ $_pages['profile.php']['title_var'] = 'profile';
 $_pages['profile.php']['parent']    = 'index.php';
 
 
-/*
-if (($_SESSION['course_id'] > 0) && isset($_modules)) {
-       foreach ($_modules as $module) {
-               if (in_array($module, $_pages[AT_NAV_COURSE])) {
-                       $_pages[$module]['parent'] = AT_NAV_COURSE;
-               } else {
-                       $_pages[$module]['parent'] = 'index.php';
-               }
-       }
-}
-*/
-
 /* global pages */
 $_pages['about.php']['title_var']  = 'about_atutor';
 
index a581e4d..4fd459d 100644 (file)
@@ -119,11 +119,7 @@ if (isset($this_login, $this_password) && !isset($_SESSION['session_test'])) {
 
                        $msg->addFeedback('LOGIN_SUCCESS');
 
-                       if ($_SESSION['privileges'] == 1) {
-                               header('Location: admin/index.php');
-                       } else {
-                               header('Location: admin/admins/my_edit.php');
-                       }
+                       header('Location: admin/index.php');
                        exit;
 
                } else {
index 1e754ba..70ff64d 100644 (file)
@@ -6,8 +6,8 @@ define('AT_ADMIN_PRIV_LANGUAGES', $this->getAdminPrivilege());
 \r
 if (admin_authenticate(AT_ADMIN_PRIV_LANGUAGES, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
        if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
-               $this->_pages['admin/index.php']['children']  = array('admin/language.php');\r
-               $this->_pages['admin/language.php']['parent'] = 'admin/index.php';\r
+               $this->_pages['admin/config_edit.php']['children']  = array('admin/language.php');\r
+               $this->_pages['admin/language.php']['parent'] = 'admin/config_edit.php';\r
        } else {\r
                $this->_pages[AT_NAV_ADMIN] = array('admin/language.php');\r
                $this->_pages['admin/language.php']['parent'] = AT_NAV_ADMIN;\r
index 08a9db7..571fb4b 100644 (file)
@@ -6,8 +6,8 @@ define('AT_ADMIN_PRIV_THEMES', $this->getAdminPrivilege());
 \r
 if (admin_authenticate(AT_ADMIN_PRIV_THEMES, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
        if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
-               $this->_pages['admin/index.php']['children']      = array('admin/themes/index.php');\r
-               $this->_pages['admin/themes/index.php']['parent'] = 'admin/index.php';\r
+               $this->_pages['admin/config_edit.php']['children']      = array('admin/themes/index.php');\r
+               $this->_pages['admin/themes/index.php']['parent'] = 'admin/config_edit.php';\r
        } else {\r
                $this->_pages[AT_NAV_ADMIN] = array('admin/themes/index.php');\r
                $this->_pages['admin/themes/index.php']['parent'] = AT_NAV_ADMIN;\r
index a2e026d..f27e132 100644 (file)
@@ -12,7 +12,35 @@ if (admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE) || admin_authenticate(AT_ADMIN
        $this->_pages['admin/users.php']['title_var'] = 'users';\r
        $this->_pages['admin/users.php']['parent']    = AT_NAV_ADMIN;\r
        $this->_pages['admin/users.php']['guide']     = 'admin/?p=3.0.users.php';\r
-       $this->_pages['admin/users.php']['children']  = array('admin/create_user.php', 'admin/default_preferences.php', 'admin/instructor_requests.php', 'admin/master_list.php', 'admin/admin_email.php', 'admin/admins/index.php');\r
+       $this->_pages['admin/users.php']['children']  = array('admin/create_user.php', 'admin/default_preferences.php', 'admin/instructor_requests.php', 'admin/master_list.php', 'admin/admin_email.php');\r
+\r
+       if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
+               $this->_pages['admin/users.php']['children'][]  = 'admin/admins/index.php';\r
+\r
+               $this->_pages['admin/admins/index.php']['title_var'] = 'administrators';\r
+               $this->_pages['admin/admins/index.php']['parent']    = 'admin/users.php';\r
+               $this->_pages['admin/admins/index.php']['guide']     = 'admin/?p=3.4.administrators.php';\r
+               $this->_pages['admin/admins/index.php']['children']  = array('admin/admins/create.php', 'admin/admins/log.php');\r
+\r
+                       $this->_pages['admin/admins/log.php']['title_var'] = 'admin_log';\r
+                       $this->_pages['admin/admins/log.php']['parent']    = 'admin/admins/index.php';\r
+                       $this->_pages['admin/admins/log.php']['children']  = array('admin/admins/reset_log.php');\r
+\r
+                               $this->_pages['admin/admins/reset_log.php']['title_var'] = 'reset_log';\r
+                               $this->_pages['admin/admins/reset_log.php']['parent']    = 'admin/admins/log.php';\r
+\r
+                               $this->_pages['admin/admins/detail_log.php']['title_var'] = 'details';\r
+                               $this->_pages['admin/admins/detail_log.php']['parent']    = 'admin/admins/log.php';\r
+\r
+                       $this->_pages['admin/admins/create.php']['title_var'] = 'create_admin';\r
+                       $this->_pages['admin/admins/create.php']['parent']    = 'admin/admins/index.php';\r
+\r
+                       $this->_pages['admin/admins/edit.php']['title_var'] = 'edit_admin';\r
+                       $this->_pages['admin/admins/edit.php']['parent']    = 'admin/admins/index.php';\r
+\r
+                       $this->_pages['admin/admins/delete.php']['title_var'] = 'delete_admin';\r
+                       $this->_pages['admin/admins/delete.php']['parent']    = 'admin/admins/index.php';\r
+       }\r
 \r
                $this->_pages['admin/admin_email.php']['title_var'] = 'admin_email';\r
                $this->_pages['admin/admin_email.php']['parent']    = 'admin/users.php';\r
@@ -28,7 +56,6 @@ if (admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE) || admin_authenticate(AT_ADMIN
                $this->_pages['admin/password_user.php']['title_var'] = 'password';\r
                $this->_pages['admin/password_user.php']['parent']    = 'admin/users.php';\r
 \r
-\r
                $this->_pages['admin/instructor_requests.php']['title_var'] = 'instructor_requests';\r
                $this->_pages['admin/instructor_requests.php']['parent']    = 'admin/users.php';\r
                $this->_pages['admin/instructor_requests.php']['guide']     = 'admin/?p=3.1.instructor_requests.php';\r
@@ -49,32 +76,8 @@ if (admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE) || admin_authenticate(AT_ADMIN
                $this->_pages['admin/edit_user.php']['title_var'] = 'edit_user';\r
                $this->_pages['admin/edit_user.php']['parent']    = 'admin/users.php';\r
 \r
-               $this->_pages['admin/admin_delete.php']['title_var'] = 'delete_user';\r
-               $this->_pages['admin/admin_delete.php']['parent']    = 'admin/users.php';\r
-\r
-               $this->_pages['admin/admins/index.php']['title_var'] = 'administrators';\r
-               $this->_pages['admin/admins/index.php']['parent']    = 'admin/users.php';\r
-               $this->_pages['admin/admins/index.php']['guide']     = 'admin/?p=3.4.administrators.php';\r
-               $this->_pages['admin/admins/index.php']['children']  = array('admin/admins/create.php', 'admin/admins/log.php');\r
-\r
-                       $this->_pages['admin/admins/log.php']['title_var'] = 'admin_log';\r
-                       $this->_pages['admin/admins/log.php']['parent']    = 'admin/admins/index.php';\r
-                       $this->_pages['admin/admins/log.php']['children']  = array('admin/admins/reset_log.php');\r
-\r
-                               $this->_pages['admin/admins/reset_log.php']['title_var'] = 'reset_log';\r
-                               $this->_pages['admin/admins/reset_log.php']['parent']    = 'admin/admins/log.php';\r
-\r
-                               $this->_pages['admin/admins/detail_log.php']['title_var'] = 'details';\r
-                               $this->_pages['admin/admins/detail_log.php']['parent']    = 'admin/admins/log.php';\r
-\r
-                       $this->_pages['admin/admins/create.php']['title_var'] = 'create_admin';\r
-                       $this->_pages['admin/admins/create.php']['parent']    = 'admin/admins/index.php';\r
-\r
-                       $this->_pages['admin/admins/edit.php']['title_var'] = 'edit_admin';\r
-                       $this->_pages['admin/admins/edit.php']['parent']    = 'admin/admins/index.php';\r
-\r
-                       $this->_pages['admin/admins/delete.php']['title_var'] = 'delete_admin';\r
-                       $this->_pages['admin/admins/delete.php']['parent']    = 'admin/admins/index.php';\r
+       $this->_pages['admin/admin_delete.php']['title_var'] = 'delete_user';\r
+       $this->_pages['admin/admin_delete.php']['parent']    = 'admin/users.php';\r
 \r
 }\r
 ?>
\ No newline at end of file
index 407e7a1..5bd8e29 100644 (file)
@@ -2,12 +2,15 @@
 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }\r
 \r
-$this->_pages['admin/index.php']['children'] = array('google_search/admin/module_prefs.php');\r
+$_student_tool = 'google_search/index.php';\r
+\r
+if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
+       $this->_pages['admin/config_edit.php']['children'] = array('google_search/admin/module_prefs.php');\r
 \r
        $this->_pages['google_search/admin/module_prefs.php']['title_var'] = 'google_key';\r
-       $this->_pages['google_search/admin/module_prefs.php']['parent']    = 'admin/index.php';\r
+       $this->_pages['google_search/admin/module_prefs.php']['parent']    = 'admin/config_edit.php';\r
+}\r
 \r
-$_student_tool = 'google_search/index.php';\r
 \r
 //side menu\r
 $this->_stacks['google_search'] = array('title_var'=>'google_search', 'file'=>dirname(__FILE__).'/side_menu.inc.php');\r
index 6ac930a..ef2bacb 100644 (file)
@@ -13,8 +13,8 @@ define('AT_FEED_SHOW_DESCRIPTION', FALSE);
 if (admin_authenticate(AT_ADMIN_PRIV_RSS, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
 \r
        if (admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
-               $this->_pages['admin/index.php']['children']      = array('admin/rss_feeds/index.php');\r
-               $this->_pages['admin/rss_feeds/index.php']['parent'] = 'admin/index.php';\r
+               $this->_pages['admin/config_edit.php']['children']      = array('admin/rss_feeds/index.php');\r
+               $this->_pages['admin/rss_feeds/index.php']['parent'] = 'admin/config_edit.php';\r
        } else {\r
                $this->_pages[AT_NAV_ADMIN] = array('admin/rss_feeds/index.php');\r
                $this->_pages['admin/rss_feeds/index.php']['parent'] = AT_NAV_ADMIN;\r