@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | $htmlHeadXtra[] = api_get_password_checker_js('#username', '#password1'); |
34 | -$htmlHeadXtra[] = '<link href="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
35 | -$htmlHeadXtra[] = '<script src="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
34 | +$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
35 | +$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
36 | 36 | $htmlHeadXtra[] = '<script> |
37 | 37 | $(document).ready(function() { |
38 | 38 | var $image = $("#previewImage"); |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | if (api_is_western_name_order()) { |
169 | 169 | // FIRST NAME and LAST NAME |
170 | 170 | $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40)); |
171 | - $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40)); |
|
171 | + $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40)); |
|
172 | 172 | } else { |
173 | 173 | // LAST NAME and FIRST NAME |
174 | - $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40)); |
|
174 | + $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40)); |
|
175 | 175 | $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40)); |
176 | 176 | } |
177 | 177 | if (api_get_setting('profile', 'name') !== 'true') { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $form->applyFilter(array('lastname', 'firstname'), 'stripslashes'); |
181 | 181 | $form->applyFilter(array('lastname', 'firstname'), 'trim'); |
182 | 182 | $form->applyFilter(array('lastname', 'firstname'), 'html_filter'); |
183 | -$form->addRule('lastname' , get_lang('ThisFieldIsRequired'), 'required'); |
|
183 | +$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required'); |
|
184 | 184 | $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required'); |
185 | 185 | |
186 | 186 | // USERNAME |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $form->freeze('email'); |
224 | 224 | } |
225 | 225 | |
226 | -if (api_get_setting('registration', 'email') == 'true' && api_get_setting('profile', 'email') == 'true') { |
|
226 | +if (api_get_setting('registration', 'email') == 'true' && api_get_setting('profile', 'email') == 'true') { |
|
227 | 227 | $form->applyFilter('email', 'stripslashes'); |
228 | 228 | $form->applyFilter('email', 'trim'); |
229 | 229 | $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required'); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | // the $jquery_ready_content variable collects all functions that |
391 | 391 | // will be load in the $(document).ready javascript function |
392 | -$htmlHeadXtra[] ='<script> |
|
392 | +$htmlHeadXtra[] = '<script> |
|
393 | 393 | $(document).ready(function(){ |
394 | 394 | '.$jquery_ready_content.' |
395 | 395 | }); |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | |
546 | 546 | if (!check_user_email($user_data['email']) && |
547 | 547 | empty($user_data['password0']) |
548 | - ){ |
|
548 | + ) { |
|
549 | 549 | Display::addFlash( |
550 | 550 | Display:: return_message( |
551 | 551 | get_lang('ToChangeYourEmailMustTypeYourPassword'), |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | $available_values_to_modify = array(); |
655 | 655 | foreach ($profile_list as $key => $status) { |
656 | 656 | if ($status == 'true') { |
657 | - switch($key) { |
|
657 | + switch ($key) { |
|
658 | 658 | case 'login': |
659 | 659 | $available_values_to_modify[] = 'username'; |
660 | 660 | break; |
@@ -787,10 +787,10 @@ discard block |
||
787 | 787 | |
788 | 788 | if (isset($_GET['type']) && $_GET['type'] == 'extended') { |
789 | 789 | $actions .= '<a href="profile.php?type=reduced'.$show.'">'. |
790 | - Display::return_icon('edit.png', get_lang('EditNormalProfile'),'',16).'</a>'; |
|
790 | + Display::return_icon('edit.png', get_lang('EditNormalProfile'), '', 16).'</a>'; |
|
791 | 791 | } else { |
792 | 792 | $actions .= '<a href="profile.php?type=extended'.$show.'">'. |
793 | - Display::return_icon('edit.png', get_lang('EditExtendProfile'),'',16).'</a>'; |
|
793 | + Display::return_icon('edit.png', get_lang('EditExtendProfile'), '', 16).'</a>'; |
|
794 | 794 | } |
795 | 795 | $actions .= '</div>'; |
796 | 796 | } |
@@ -9,5 +9,5 @@ |
||
9 | 9 | require_once('authcas.php'); |
10 | 10 | global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri; |
11 | 11 | |
12 | -phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri); |
|
12 | +phpCAS::client($cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri); |
|
13 | 13 | phpCAS::logout(); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $firstpage = $_GET['firstpage']; |
40 | 40 | setcookie("GotoCourse", $firstpage); |
41 | 41 | } |
42 | - if (!is_object($PHPCAS_CLIENT) ) { |
|
42 | + if (!is_object($PHPCAS_CLIENT)) { |
|
43 | 43 | phpCAS::client( |
44 | 44 | $cas_auth_ver, |
45 | 45 | $cas_auth_server, |
@@ -131,17 +131,17 @@ discard block |
||
131 | 131 | * |
132 | 132 | * @public |
133 | 133 | */ |
134 | - function PGTStorageFile($cas_parent,$format,$path) |
|
134 | + function PGTStorageFile($cas_parent, $format, $path) |
|
135 | 135 | { |
136 | 136 | phpCAS::traceBegin(); |
137 | 137 | // call the ancestor's constructor |
138 | 138 | $this->PGTStorage($cas_parent); |
139 | 139 | |
140 | - if (empty($format) ) $format = CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT; |
|
141 | - if (empty($path) ) $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH; |
|
140 | + if (empty($format)) $format = CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT; |
|
141 | + if (empty($path)) $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH; |
|
142 | 142 | |
143 | 143 | // check that the path is an absolute path |
144 | - if (getenv("OS")=="Windows_NT"){ |
|
144 | + if (getenv("OS") == "Windows_NT") { |
|
145 | 145 | |
146 | 146 | if (!preg_match('`^[a-zA-Z]:`', $path)) { |
147 | 147 | phpCAS::error('an absolute path is needed for PGT storage to file'); |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | else |
152 | 152 | { |
153 | 153 | |
154 | - if ( $path[0] != '/' ) { |
|
154 | + if ($path[0] != '/') { |
|
155 | 155 | phpCAS::error('an absolute path is needed for PGT storage to file'); |
156 | 156 | } |
157 | 157 | |
158 | 158 | // store the path (with a leading and trailing '/') |
159 | - $path = preg_replace('|[/]*$|','/',$path); |
|
160 | - $path = preg_replace('|^[/]*|','/',$path); |
|
159 | + $path = preg_replace('|[/]*$|', '/', $path); |
|
160 | + $path = preg_replace('|^[/]*|', '/', $path); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $this->_path = $path; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | phpCAS::traceBegin(); |
188 | 188 | // if the storage has already been initialized, return immediatly |
189 | - if ( $this->isInitialized() ) |
|
189 | + if ($this->isInitialized()) |
|
190 | 190 | return; |
191 | 191 | // call the ancestor's method (mark as initialized) |
192 | 192 | parent::init(); |
@@ -222,12 +222,12 @@ discard block |
||
222 | 222 | * |
223 | 223 | * @public |
224 | 224 | */ |
225 | - function write($pgt,$pgt_iou) |
|
225 | + function write($pgt, $pgt_iou) |
|
226 | 226 | { |
227 | 227 | phpCAS::traceBegin(); |
228 | 228 | $fname = $this->getPGTIouFilename($pgt_iou); |
229 | - if ( $f=fopen($fname,"w") ) { |
|
230 | - if ( fputs($f,$pgt) === FALSE ) { |
|
229 | + if ($f = fopen($fname, "w")) { |
|
230 | + if (fputs($f, $pgt) === FALSE) { |
|
231 | 231 | phpCAS::error('could not write PGT to `'.$fname.'\''); |
232 | 232 | } |
233 | 233 | fclose($f); |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | phpCAS::traceBegin(); |
253 | 253 | $pgt = FALSE; |
254 | 254 | $fname = $this->getPGTIouFilename($pgt_iou); |
255 | - if ( !($f=fopen($fname,"r")) ) { |
|
255 | + if (!($f = fopen($fname, "r"))) { |
|
256 | 256 | phpCAS::trace('could not open `'.$fname.'\''); |
257 | 257 | } else { |
258 | - if ( ($pgt=fgets($f)) === FALSE ) { |
|
258 | + if (($pgt = fgets($f)) === FALSE) { |
|
259 | 259 | phpCAS::trace('could not read PGT from `'.$fname.'\''); |
260 | 260 | } |
261 | 261 | fclose($f); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @hideinitializer |
58 | 58 | * @private |
59 | 59 | */ |
60 | - var $_url=''; |
|
60 | + var $_url = ''; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * This method returns the PEAR DB URL to use to connect to the database. |
@@ -159,18 +159,18 @@ discard block |
||
159 | 159 | * |
160 | 160 | * @public |
161 | 161 | */ |
162 | - function PGTStorageDB($cas_parent,$user,$password,$database_type,$hostname,$port,$database,$table) |
|
162 | + function PGTStorageDB($cas_parent, $user, $password, $database_type, $hostname, $port, $database, $table) |
|
163 | 163 | { |
164 | 164 | phpCAS::traceBegin(); |
165 | 165 | |
166 | 166 | // call the ancestor's constructor |
167 | 167 | $this->PGTStorage($cas_parent); |
168 | 168 | |
169 | - if ( empty($database_type) ) $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE; |
|
170 | - if ( empty($hostname) ) $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME; |
|
171 | - if ( $port==0 ) $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT; |
|
172 | - if ( empty($database) ) $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE; |
|
173 | - if ( empty($table) ) $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE; |
|
169 | + if (empty($database_type)) $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE; |
|
170 | + if (empty($hostname)) $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME; |
|
171 | + if ($port == 0) $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT; |
|
172 | + if (empty($database)) $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE; |
|
173 | + if (empty($table)) $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE; |
|
174 | 174 | |
175 | 175 | // build and store the PEAR DB URL |
176 | 176 | $this->_url = $database_type.':'.'//'.$user.':'.$password.'@'.$hostname.':'.$port.'/'.$database; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | phpCAS::traceBegin(); |
194 | 194 | // if the storage has already been initialized, return immediatly |
195 | - if ( $this->isInitialized() ) |
|
195 | + if ($this->isInitialized()) |
|
196 | 196 | return; |
197 | 197 | // call the ancestor's method (mark as initialized) |
198 | 198 | parent::init(); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | // try to connect to the database |
207 | 207 | $this->_link = DB::connect($this->getURL()); |
208 | - if ( DB::isError($this->_link) ) { |
|
208 | + if (DB::isError($this->_link)) { |
|
209 | 209 | phpCAS::error('could not connect to database ('.DB::errorMessage($this->_link).')'); |
210 | 210 | } |
211 | 211 | var_dump($this->_link); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | function PGTStorage($cas_parent) |
64 | 64 | { |
65 | 65 | phpCAS::traceBegin(); |
66 | - if ( !$cas_parent->isProxy() ) { |
|
66 | + if (!$cas_parent->isProxy()) { |
|
67 | 67 | phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy'); |
68 | 68 | } |
69 | 69 | phpCAS::traceEnd(); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @private |
108 | 108 | * @deprecated not used. |
109 | 109 | */ |
110 | - var $_error_message=FALSE; |
|
110 | + var $_error_message = FALSE; |
|
111 | 111 | |
112 | 112 | /** |
113 | 113 | * This method sets en error message, which can be read later by |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * |
186 | 186 | * @protected |
187 | 187 | */ |
188 | - function write($pgt,$pgt_iou) |
|
188 | + function write($pgt, $pgt_iou) |
|
189 | 189 | { |
190 | 190 | phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); |
191 | 191 | } |
@@ -12,13 +12,13 @@ |
||
12 | 12 | /** |
13 | 13 | * a phpCAS string index |
14 | 14 | */ |
15 | -define("CAS_STR_USING_SERVER", 1); |
|
16 | -define("CAS_STR_AUTHENTICATION_WANTED", 2); |
|
17 | -define("CAS_STR_LOGOUT", 3); |
|
15 | +define("CAS_STR_USING_SERVER", 1); |
|
16 | +define("CAS_STR_AUTHENTICATION_WANTED", 2); |
|
17 | +define("CAS_STR_LOGOUT", 3); |
|
18 | 18 | define("CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED", 4); |
19 | -define("CAS_STR_AUTHENTICATION_FAILED", 5); |
|
20 | -define("CAS_STR_YOU_WERE_NOT_AUTHENTICATED", 6); |
|
21 | -define("CAS_STR_SERVICE_UNAVAILABLE", 7); |
|
19 | +define("CAS_STR_AUTHENTICATION_FAILED", 5); |
|
20 | +define("CAS_STR_YOU_WERE_NOT_AUTHENTICATED", 6); |
|
21 | +define("CAS_STR_SERVICE_UNAVAILABLE", 7); |
|
22 | 22 | //@} |
23 | 23 | |
24 | 24 | ?> |
25 | 25 | \ No newline at end of file |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $limit |
204 | 204 | ); |
205 | 205 | } else { |
206 | - header('Location: ' . api_get_self()); |
|
206 | + header('Location: '.api_get_self()); |
|
207 | 207 | } |
208 | 208 | break; |
209 | 209 | case 'display_random_courses': |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $continueWithSubscription = SequenceResourceManager::checkSequenceAreCompleted($requirementsData); |
279 | 279 | |
280 | 280 | if (!$continueWithSubscription) { |
281 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'auth/courses.php'); |
|
281 | + header('Location: '.api_get_path(WEB_CODE_PATH).'auth/courses.php'); |
|
282 | 282 | exit; |
283 | 283 | } |
284 | 284 | } |
@@ -296,16 +296,16 @@ discard block |
||
296 | 296 | |
297 | 297 | if ($count <= 0) { |
298 | 298 | // no course in session -> return to catalog |
299 | - $url = api_get_path(WEB_CODE_PATH) . 'auth/courses.php'; |
|
299 | + $url = api_get_path(WEB_CODE_PATH).'auth/courses.php'; |
|
300 | 300 | } elseif ($count == 1) { |
301 | 301 | // only one course, so redirect directly to this course |
302 | 302 | foreach ($coursesList as $course) { |
303 | - $url = api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . intval($_GET['session_id']); |
|
303 | + $url = api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.intval($_GET['session_id']); |
|
304 | 304 | } |
305 | 305 | } else { |
306 | - $url = api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . intval($_GET['session_id']); |
|
306 | + $url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.intval($_GET['session_id']); |
|
307 | 307 | } |
308 | - header('Location: ' . $url); |
|
308 | + header('Location: '.$url); |
|
309 | 309 | exit; |
310 | 310 | } |
311 | 311 | //else show error message? |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | $msg .= '<div class="well_login">'; |
43 | 43 | $msg .= $form->return_form(); |
44 | - $msg .='</div>'; |
|
44 | + $msg .= '</div>'; |
|
45 | 45 | if (api_is_cas_activated()) { |
46 | 46 | $msg .= "</div>"; |
47 | 47 | } |