Project

General

Profile

« Previous | Next » 

Revision 2099

Added by darkviper almost 11 years ago

  1. first fixes from rev.2098

View differences:

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