Project

General

Profile

« Previous | Next » 

Revision 2099

Added by darkviper over 10 years ago

  1. first fixes from rev.2098

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
11 Feb-2014 Build 2099 Manuela v.d.Decken(DarkViper)
15
# first fixes from rev.2098
14 16
11 Feb-2014 Build 2098 Manuela v.d.Decken(DarkViper)
15 17
! activate class Translate for all addons in admin/ (except pages/)
16 18
! class.admin >> add translation of the current theme to Translate
branches/2.8.x/wb/upgrade-script.php
89 89
// --- set DEFAULT_THEME and restart if needed -------------------------------------------
90 90
if (isset($oReg->DefaultTheme) && $oReg->DefaultTheme != 'WbTheme') {
91 91
    db_update_key_value('settings', 'default_theme', 'WbTheme');
92
    $sLocation = 'Location: '.$oReg->AppUrl.filename(__FILE__);
92
    $sLocation = 'Location: '.$oReg->AppUrl.basename(__FILE__);
93 93
    header($sLocation);
94 94
    exit;
95 95
}
branches/2.8.x/wb/admin/start/index.php
72 72
// ---------------------------------------
73 73
if(($admin->get_user_id()==1) && file_exists(WB_PATH.'/upgrade-script.php')) {
74 74
	// check if it is neccessary to start the uograde-script
75
	$sql = 'SELECT `value` FROM `'.$oDb-TablePrefix.'settings` WHERE `name`=\'wb_revision\'';
75
	$sql = 'SELECT `value` FROM `'.$oDb->TablePrefix.'settings` WHERE `name`=\'wb_revision\'';
76 76
	$wb_revision = $oDb->getOne($sql);
77 77
	if (version_compare($wb_revision, REVISION ) < 0) {
78 78
echo "<p style=\"text-align:center;\"> If the <strong>upgrade script</strong> could not be start automatically.\n" .
......
133 133
/**
134 134
 * delete Outdated Confirmations
135 135
 */
136
$sql = 'DELETE FROM `'.$oDb-TablePrefix.'users` WHERE `confirm_timeout` BETWEEN 1 AND '.time();
136
$sql = 'DELETE FROM `'.$oDb->TablePrefix.'users` WHERE `confirm_timeout` BETWEEN 1 AND '.time();
137 137
$oDb->doQuery($sql);
138 138

  
139 139
/**
140 140
 * delete stored ip adresses default after 60 days
141 141
 */
142
$sql = 'UPDATE `'.$oDb-TablePrefix.'users` SET `login_ip` = \'\' WHERE `login_when` < '.(time()-(60*84600));
142
$sql = 'UPDATE `'.$oDb->TablePrefix.'users` SET `login_ip` = \'\' WHERE `login_when` < '.(time()-(60*84600));
143 143
$oDb->doQuery($sql);
144 144

  
145 145
// ---------------------------------------
branches/2.8.x/wb/admin/skel/themes/htt/users.htt
4 4
		<td align="left"><h2>{HEADING_MODIFY_DELETE_USER}</h2></td>
5 5
		<td align="right">
6 6
		<!-- BEGIN manage_groups_block -->
7
		<form name="cmd_manage_groups" action="{ADMIN_URL}/groups/index.php" method="post">
7
		<form name="cmd_manage_groups" action="{ADMIN_URL}groups/index.php" method="post">
8 8
			{FTAN}
9 9
			<input class="submit" type="submit" name="cmd_manage_users" value="{TEXT_MANAGE_GROUPS}" />
10 10
		</form>
branches/2.8.x/wb/admin/skel/themes/htt/users_form.htt
69 69
		<select name="home_folder">
70 70
			<option value="">{TEXT_NONE}</option>
71 71
			<!-- BEGIN folder_list_block -->
72
			<option value="{FOLDER}"{SELECTED}>{NAME}</option>
72
			<option value="/{FOLDER}"{SELECTED}>/{NAME}</option>
73 73
			<!-- END folder_list_block -->
74 74
		</select>
75 75
	</td>
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.4');
54
if(!defined('REVISION')) define('REVISION', '2098');
54
if(!defined('REVISION')) define('REVISION', '2099');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/users/user_list.php
26 26

  
27 27
	function show_userlist($admin, &$aActionRequest)
28 28
	{
29
        $oReg = WbAdaptor::getInstance();
29 30
		$oDb = WbDatabase::getInstance();
30 31
		$oTrans = Translate::getInstance();
31
        $oTrans->enableAddon('admin\\users');
32 32

  
33 33
        $iUserStatus = (($admin->get_get('status') == 1) ? 0 : 1);
34 34
        unset($_GET);
......
43 43
        $oTpl->set_block("main_block", "manage_groups_block", "groups");
44 44

  
45 45
        $oTpl->set_var($oTrans->getLangArray());
46
        $oTpl->set_var('ADMIN_URL', ADMIN_URL);
46
        $oTpl->set_var('ADMIN_URL', $oReg->AcpUrl);
47 47
        $oTpl->set_var('FTAN', $admin->getFTAN());
48 48
        $oTpl->set_var('USER_STATUS', $iUserStatus );
49 49
        $oTpl->set_var('groups', '');
......
53 53
        $oTpl->set_var('HEADING_MODIFY_USER', '');
54 54
        $oTpl->set_var('DISPLAY_HOME_FOLDERS', '');
55 55

  
56
        $UserStatusActive = 'url('.THEME_URL.'/images/user.png)';
57
        $UserStatusInactive = 'url('.THEME_URL.'/images/user_red.png)';
56
        $UserStatusActive = 'url('.$oReg->ThemeUrl.'images/user.png)';
57
        $UserStatusInactive = 'url('.$oReg->ThemeUrl.'images/user_red.png)';
58 58

  
59 59
        $sUserTitle = ($iUserStatus == 0) ? $oTrans->MENU_USERS.' '.mb_strtolower($oTrans->TEXT_ACTIVE, 'UTF-8')
60 60
                                          : $oTrans->MENU_USERS.' '.mb_strtolower($oTrans->TEXT_DELETED, 'UTF-8') ;
......
117 117
        );
118 118
        // insert urls
119 119
        $oTpl->set_var(array(
120
                'ADMIN_URL' => ADMIN_URL,
121
                'WB_URL' => WB_URL,
122
                'THEME_URL' => THEME_URL
120
                'ADMIN_URL' => $oReg->AcpUrl,
121
                'WB_URL'    => $oReg->AppUrl,
122
                'THEME_URL' => $oReg->ThemeUrl
123 123
        		)
124 124
        );
125 125
        // Insert language text and messages
......
179 179

  
180 180
        $oTpl->set_block('main_block', 'show_add_loginname_block', 'show_add_loginname');
181 181
		$oTpl->set_block('main_block', 'show_change_group_list_block', 'show_change_group_list');
182

  
182
        $oTpl->se_var($oTrans->getLangArray());
183 183
		$oTpl->parse('show_change_group_list', '');
184 184
//		$oTpl->parse('show_change_group_list', 'show_change_group_list_block', true);
185 185

  
186 186
		$oTpl->set_var(	array(
187
    			   'ACTION_URL'           => ADMIN_URL.'/users/index.php',
187
                   'ADMIN_URL'            => $oReg->AcpUrl,
188
                   'WB_URL'               => $oReg->AppUrl,
189
                   'THEME_URL'            => $oReg->ThemeUrl,
190
    			   'ACTION_URL'           => $oReg->AcpUrl.'users/index.php',
188 191
    			   'FTAN'                 => $admin->getFTAN(),
189 192
    			   'DISPLAY_EXTRA'        => 'display:none;',
190 193
    			   'ACTIVE_CHECKED'       => ' checked="checked"',
......
207 210
        		'USERNAME'     => '',
208 211
        		'DISPLAY_NAME' => '',
209 212
        		'EMAIL'        => '',
210
        		'ADMIN_URL'    => ADMIN_URL,
211
        		'WB_URL'       => WB_URL,
212 213
                'SUB_ACTION'   => 'add',
213
                'CANCEL_URL'   => $aActionRequest['cancel_url'],
214
        		'THEME_URL'    => THEME_URL
214
                'CANCEL_URL'   => $aActionRequest['cancel_url']
215 215
        		)
216 216
        );
217 217

  
......
261 261
        }
262 262

  
263 263
        // Include the WB functions file
264
        if(!function_exists('directory_list')) { require(WB_PATH.'/framework/functions.php'); }
264
        if(!function_exists('directory_list')) { require($oReg->AppUrl.'framework/functions.php'); }
265 265

  
266 266
        // Add media folders to home folder list
267 267
        $oTpl->set_block('main_block', 'folder_list_block', 'folder_list');
268
        foreach(directory_list(WB_PATH.MEDIA_DIRECTORY) AS $name) {
269
        	$oTpl->set_var('NAME', str_replace(WB_PATH, '', $name));
270
        	$oTpl->set_var('FOLDER', str_replace(WB_PATH.MEDIA_DIRECTORY, '', $name));
268
        foreach(directory_list($oReg->AppPath.$oReg->MediaDir) AS $name) {
269
        	$oTpl->set_var('NAME', str_replace($oReg->AppPath, '', $name));
270
        	$oTpl->set_var('FOLDER', str_replace($oReg->AppPath.$oReg->MediaDir, '', $name));
271 271
        	$oTpl->set_var('SELECTED', ' ');
272 272
        	$oTpl->parse('folder_list', 'folder_list_block', true);
273 273
        }
branches/2.8.x/wb/admin/users/user_form.php
26 26

  
27 27
	function show_usermask($admin, &$aActionRequest)
28 28
	{
29
        $oReg = WbAdaptor::getInstance();
29 30
		$oDb = WbDatabase::getInstance();
30 31
		$oTrans = Translate::getInstance();
31 32
        $oTrans->enableAddon('admin\\users');
......
61 62
    		$oTpl->parse('show_change_group_list', '');
62 63
		}
63 64
		$oTpl->set_var(	array(
64
            'ACTION_URL'   => ADMIN_URL.'/users/index.php',
65
            'ACTION_URL'           => $oReg->AcpUrl.'users/index.php',
65 66
            'SUB_ACTION'           => 'save',
66 67
            'BACK_LINK'            => (isset($aActionRequest['BackLink'])) ? $aActionRequest['BackLink'] : '',
67 68
            'CANCEL_URL'           => $aActionRequest['cancel_url'],
......
72 73
            'USERNAME'             => $user['username'],
73 74
            'DISPLAY_NAME'         => $user['display_name'],
74 75
            'EMAIL'                => $user['email'],
75
            'ADMIN_URL'            => ADMIN_URL,
76
            'WB_URL'               => WB_URL,
77
            'THEME_URL'            => THEME_URL
76
            'ADMIN_URL'            => $oReg->AcpUrl,
77
            'WB_URL'               => $oReg->AppUrl,
78
            'THEME_URL'            => $oReg->ThemeUrl
78 79
            )
79 80
        );
80 81

  
......
146 147
		// Generate username field name
147 148
		$username_fieldname = 'username_'.substr(base_convert(microtime(), 16, 36), 0, 8);
148 149
		// Work-out if home folder should be shown
149
		if(!HOME_FOLDERS) {
150
		if(!$oReg->HomeFolders) {
150 151
			$oTpl->set_var('DISPLAY_HOME_FOLDERS', 'display:none;');
151 152
		}
152 153

  
153 154
		// Include the WB functions file
154
        if(!function_exists('directory_list')) { require(WB_PATH.'/framework/functions.php'); }
155
        if(!function_exists('directory_list')) { require($oReg->AppPath.'framework/functions.php'); }
155 156

  
156 157
		// Add media folders to home folder list
157 158
		$oTpl->set_block('main_block', 'folder_list_block', 'folder_list');
158
		foreach(directory_list(WB_PATH.MEDIA_DIRECTORY) AS $name)
159
		foreach(directory_list($oReg->AppPath.$oReg->MediaDir) AS $name)
159 160
	    {
160
			$oTpl->set_var('NAME', str_replace(WB_PATH, '', $name));
161
			$oTpl->set_var('FOLDER', str_replace(WB_PATH.MEDIA_DIRECTORY, '', $name));
162
			if($user['home_folder'] == str_replace(WB_PATH.MEDIA_DIRECTORY, '', $name)) {
161
			$oTpl->set_var('NAME', str_replace($oReg->AppPath, '', $name));
162
			$oTpl->set_var('FOLDER', str_replace($oReg->AppPath.$oReg->MediaDir, '', $name));
163
			if($user['home_folder'] == str_replace($oReg->AppPath.$oReg->MediaDir, '', $name)) {
163 164
				$oTpl->set_var('SELECTED', ' selected="selected"');
164 165
			} else {
165 166
				$oTpl->set_var('SELECTED', ' ');
branches/2.8.x/wb/admin/users/delete.php
27 27
{
28 28
	$oDb = WbDatabase::getInstance();
29 29
	$oTrans = Translate::getInstance();
30
    $oTrans->enableAddon('admin\\users');
31 30
    $aUserID = array();
32 31
    $bRetVal = false;
33 32

  
branches/2.8.x/wb/admin/users/index.php
33 33

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

  
40
        $sAdminPath = dirname(str_replace('\\', '/', __FILE__));
41
        $sAdminName = basename($sAdminPath);
41
        $sModulePath = rtrim(dirname(str_replace('\\', '/', __FILE__)), '/').'/';
42
        $sAdminName = basename($sModulePath);
42 43
        $output = '';
43 44
        $aActionRequest['requestMethod'] = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
44 45
        $action = 'show';
......
56 57
			case 'delete_outdated': // delete Users awaiting activation
57 58
			case 'enable_outdated': // enable Users awaiting activation
58 59
    			$admin = new admin('Access', 'users_delete',false);
59
				include($sAdminPath.'/delete.php');
60
				include($sModulePath.'delete.php');
60 61
    			delete_user($admin,$aActionRequest);
61
                $aActionRequest['cancel_url'] = ADMIN_URL.'/access/index.php';
62
                $aActionRequest['cancel_url'] = $oReg->AcpUrl.'access/index.php';
62 63
				$admin = new admin('Access', 'users');
63
				include($sAdminPath.'/user_list.php');
64
				include($sModulePath.'user_list.php');
64 65
				$output .= show_userlist($admin, $aActionRequest);
65 66
				break;
66 67
			case 'add': // insert/update user
67 68
                $admin = new admin('Access', 'users_add',false);
68
				include($sAdminPath.'/add.php');
69
				include($sModulePath.'add.php');
69 70
    			add_user($admin,$aActionRequest);
70
                $aActionRequest['cancel_url'] = ADMIN_URL.'/access/index.php';
71
                $aActionRequest['cancel_url'] = $oReg->AcpUrl.'access/index.php';
71 72
				$admin = new admin('Access', 'users');
72
				include($sAdminPath.'/user_list.php');
73
				include($sModulePath.'user_list.php');
73 74
				$output .= show_userlist($admin, $aActionRequest);
74 75
				break;
75 76
			case 'save': // insert/update user
......
80 81
                    $aActionRequest['cancel_url'] = $sBackLink;
81 82
                    $aActionRequest['BackLink'] = $sBackLink;
82 83
                }
83
     			include($sAdminPath.'/save.php');
84
     			include($sModulePath.'save.php');
84 85
                $user_id = save_user($admin, $aActionRequest);
85 86
    			$admin = new admin('Access', 'users_modify');
86
     			include($sAdminPath.'/user_form.php');
87
     			include($sModulePath.'user_form.php');
87 88
                $aActionRequest['user_id'] = $user_id;
88 89
    			$output = show_usermask($admin,$aActionRequest);
89 90
				break;
......
98 99
    				msgQueue::clear();
99 100
        			msgQueue::add($oTrans->MESSAGE_GENERIC_FORGOT_OPTIONS );
100 101
                    $aActionRequest['user_id'] = $user_id;
101
                    $aActionRequest['cancel_url'] = ADMIN_URL.'/access/index.php';
102
					include($sAdminPath.'/user_list.php');
102
                    $aActionRequest['cancel_url'] = $oReg->AcpUrl.'access/index.php';
103
					include($sModulePath.'user_list.php');
103 104
					$output  = show_userlist($admin, $aActionRequest);
104 105
    				break;
105 106
                }
......
107 108
    			if( ($user_id == $admin->get_user_id() ) )
108 109
    			{
109 110
                    $sQueryString = (isset($_SERVER['QUERY_STRING'])&& ($_SERVER['QUERY_STRING']!='')) ? $_SERVER['QUERY_STRING'] :  'tool=uaerat';
110
                    $admin->send_header(ADMIN_URL.'/preferences/index.php?'.$sQueryString);
111
                    $admin->send_header($oReg->AcpUrl.'preferences/index.php?'.$sQueryString);
111 112
    			}
112 113

  
113 114
    			$admin = new admin('Access', 'users_modify');
......
127 128
                    $aActionRequest['cancel_url'] = $sBackLink;
128 129
                    $aActionRequest['BackLink']   = $sBackLink;
129 130
                }
130
     			include($sAdminPath.'/user_form.php');
131
     			include($sModulePath.'user_form.php');
131 132
    			$output = show_usermask($admin,$aActionRequest);
132 133
				break;
133 134
			default: // show userlist with empty modify mask
......
136 137
    			$user_id = intval($admin->checkIDKEY('user_id', 0, $_SERVER['REQUEST_METHOD']));
137 138
    			// Check if user id is a valid number and doesnt equal 1
138 139
                $aActionRequest['user_id'] = $user_id;
139
                $aActionRequest['cancel_url'] = ADMIN_URL.'/access/index.php';
140
                $aActionRequest['cancel_url'] = $oReg->AcpUrl.'access/index.php';
140 141
				if($user_id > 1) // prevent 'admin' [ID 1] from modify
141 142
				{
142
					include($sAdminPath.'/user_form.php');
143
					include($sModulePath.'user_form.php');
143 144
					$output .= show_usermask($admin, $aActionRequest);
144 145
				} elseif($user_id == 0) { // if invalid UserID is called, fall back to 'show-mode'
145
					include($sAdminPath.'/user_list.php');
146
					include($sModulePath.'user_list.php');
146 147
					$output  = show_userlist($admin, $aActionRequest);
147 148
				}
148 149
		endswitch; // end of switch

Also available in: Unified diff