Project

General

Profile

« Previous | Next » 

Revision 2098

Added by darkviper almost 11 years ago

! activate class Translate for all addons in admin/ (except pages/)
! class.admin >> add translation of the current theme to Translate

View differences:

index.php
23 23
     */
24 24
    function findStringInFileList( $sString, $sListFile)
25 25
    {
26
     $aMatch = array();
27
     if(is_readable($sListFile)) {
28
      $aList = file($sListFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
29
      $aMatch = preg_grep('/'.preg_quote($sString, '/').'/i',$aList);
30
     }
31
     return (sizeof($aMatch)>0);
26
        $aMatch = array();
27
        if(is_readable($sListFile)) {
28
            $aList = file($sListFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
29
            $aMatch = preg_grep('/'.preg_quote($sString, '/').'/i',$aList);
30
        }
31
        return (sizeof($aMatch)>0);
32 32
    }
33 33

  
34 34
	function admin_users_index($aActionRequest)
35 35
	{
36
		$database = WbDatabase::getInstance();
37
		$mLang = Translate::getInstance();
38
		$mLang->enableAddon('admin\users');
36
		$oDb = WbDatabase::getInstance();
37
		$oTrans = Translate::getInstance();
38
		$oTrans->enableAddon('admin\\users');
39 39

  
40 40
        $sAdminPath = dirname(str_replace('\\', '/', __FILE__));
41 41
        $sAdminName = basename($sAdminPath);
......
96 96
    			if($user_id == 0){
97 97
    				$admin = new admin('Access', 'users');
98 98
    				msgQueue::clear();
99
        			msgQueue::add($mLang->MESSAGE_GENERIC_FORGOT_OPTIONS );
99
        			msgQueue::add($oTrans->MESSAGE_GENERIC_FORGOT_OPTIONS );
100 100
                    $aActionRequest['user_id'] = $user_id;
101 101
                    $aActionRequest['cancel_url'] = ADMIN_URL.'/access/index.php';
102 102
					include($sAdminPath.'/user_list.php');
......
115 115
    			if( ($user_id < 2 ) )
116 116
    			{
117 117
    				// if($admin_header) { $admin->print_header(); }
118
    				msgQueue::add($mLang->MESSAGE_GENERIC_SECURITY_ACCESS );
118
    				msgQueue::add($oTrans->MESSAGE_GENERIC_SECURITY_ACCESS );
119 119
    			}
120 120
                $admin_header = false;
121 121
                if(isset($aActionRequest['BackLink'])) {
......
170 170
        }
171 171
		$admin->print_footer();
172 172

  
173
    }
174

  
173
    } // end of function admin_users_index()
174
/* ************************************************************************************ */
175 175
	if(!defined('WB_URL'))
176 176
	{
177
        $config_file = realpath('../../config.php');
178
        if(file_exists($config_file) && !defined('WB_URL'))
179
        {
177
        $config_file = '../../config.php';
178
        if(is_readable($config_file)) {
180 179
        	require($config_file);
180
        } else {
181
            throw new Exception('unable to read config.php');
181 182
        }
182 183
    }
183
    if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
184 184

  
185 185
    $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
186 186
    $aActionRequest = (isset(${$requestMethod})) ? ${$requestMethod} : null;

Also available in: Unified diff