diff -r f808e55fb92a -r 91f4da84966f plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Wed Apr 15 19:37:10 2009 -0400 +++ b/plugins/SpecialAdmin.php Wed Apr 15 19:44:47 2009 -0400 @@ -73,6 +73,7 @@ list($pid, $ns) = RenderMan::strToPageID($paths->get_pageid_from_url()); if ( $ns == 'Admin' || ( $pid == 'Administration' && $ns == 'Special' ) ) { + require(ENANO_ROOT . '/plugins/admin/Home.php'); require(ENANO_ROOT . '/plugins/admin/PageManager.php'); require(ENANO_ROOT . '/plugins/admin/PageEditor.php'); require(ENANO_ROOT . '/plugins/admin/PageGroups.php'); @@ -96,139 +97,6 @@ // function names are IMPORTANT!!! The name pattern is: page__ -function page_Admin_Home() { - global $db, $session, $paths, $template, $plugins; // Common objects - global $lang; - if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) - { - $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); - echo '

' . $lang->get('adm_err_not_auth_title') . '

'; - echo '

' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; - return; - } - - if ( $paths->getParam(0) == 'updates.xml' ) - { - require_once(ENANO_ROOT . '/includes/http.php'); - $req = new Request_HTTP('ktulu.enanocms.org', '/meta/updates.xml'); - $response = $req->get_response_body(); - header('Content-type: application/xml'); - if ( $req->response_code != HTTP_OK ) - { - // Error in response - echo 'response_code . ' ' . $req->response_string . ' -]]>'; - } - else - { - // Retrieve first update - $first_update = preg_match('//', $response, $match); - if ( !$first_update ) - { - echo ''; - } - else - { - if ( version_compare(enano_version(true), $match[2], '<') ) - { - $response = str_replace_once('', " \n ", $response); - } - echo $response; - } - } - return; - } - - // Basic information - echo '

' . $lang->get('acphome_heading_main') . '

'; - echo '

' . $lang->get('acphome_welcome_line1') . '

'; - echo '

' . $lang->get('acphome_welcome_line2') . '

'; - - // Demo mode - if ( defined('ENANO_DEMO_MODE') ) - { - echo '

' . $lang->get('acphome_msg_demo_title') . '

-

' . $lang->get('acphome_msg_demo_body', array('reset_url' => makeUrlNS('Special', 'DemoReset', false, true))) . '

'; - } - - // Check for the installer scripts - if( file_exists(ENANO_ROOT.'/install/install.php') && !defined('ENANO_DEMO_MODE') ) - { - echo '
- ' . $lang->get('acphome_msg_install_files') . ' -
'; - } - - echo '

' . $lang->get('acphome_heading_updates') . '

'; - echo '

' . $lang->get('acphome_msg_updates_info', array('updates_url' => 'http://ktulu.enanocms.org/meta/updates.xml')) . '

'; - echo '
'; - - // Inactive users - $q = $db->sql_query('SELECT time_id FROM '.table_prefix.'logs WHERE log_type=\'admin\' AND action=\'activ_req\';'); - if ( $q ) - { - if ( $db->numrows() > 0 ) - { - $n = $db->numrows(); - $um_flags = 'href="#" onclick="ajaxPage(\''.$paths->nslist['Admin'].'UserManager\'); return false;"'; - if ( $n == 1 ) - $s = $lang->get('acphome_msg_inactive_users_one', array('um_flags' => $um_flags)); - else - $s = $lang->get('acphome_msg_inactive_users_plural', array('um_flags' => $um_flags)); - echo '
- ' . $s . ' -
'; - } - } - $db->free_result(); - // Stats - if(getConfig('log_hits') == '1') - { - require_once(ENANO_ROOT . '/includes/stats.php'); - $stats = stats_top_pages(10); - //die('
'.print_r($stats,true).'
'); - $c = 0; - $cls = 'row2'; - echo '

' . $lang->get('acphome_heading_top_pages') . '

-
- - - - - '; - foreach($stats as $data) - { - echo ''; - $cls = ( $cls == 'row1' ) ? 'row2' : 'row1'; - echo ''; - echo ''; - } - echo '
' . $lang->get('acphome_th_toppages_page') . '' . $lang->get('acphome_th_toppages_hits') . '
- '.$data['page_title'].''.$data['num_hits'] - . '
-
'; - } - - // Any hooks? - $code = $plugins->setHook('acp_home'); - foreach ( $code as $cmd ) - { - eval($cmd); - } - - // Security log - echo '

' . $lang->get('acphome_heading_seclog') . '

'; - echo '

' . $lang->get('acphome_msg_seclog_info') . '

'; - $seclog = get_security_log(5); - echo $seclog; - - echo '

' . $lang->get('acphome_btn_seclog_full') . '

'; - -} - function page_Admin_GeneralConfig() { global $db, $session, $paths, $template, $plugins; // Common objects global $lang; @@ -390,21 +258,7 @@ setConfig('gravatar_rating', $_POST['gravatar_rating']); } - if ( is_dir(ENANO_ROOT . '/' . $_POST['avatar_directory']) ) - { - if ( preg_match('/^[A-z0-9_-]+(?:\/(?:[A-z0-9_-]+))*\/?$/', $_POST['avatar_directory']) ) - { - setConfig('avatar_directory', $_POST['avatar_directory']); - } - else - { - echo '
' . $lang->get('acpgc_err_avatar_dir_invalid') . '
'; - } - } - else - { - echo '
' . $lang->get('acpgc_err_avatar_dir_not_exist') . '
'; - } + setConfig('avatar_directory', 'files/avatars'); setConfig('userpage_grant_acl', ( isset($_POST['userpage_grant_acl']) ? '1' : '0' )); @@ -1028,16 +882,6 @@ - - - get('acpgc_field_avatar_directory'); ?>
- get('acpgc_field_avatar_directory_hint'); ?> - - - /> - - -