@@ -153,18 +153,18 @@ |
||
153 | 153 | // Check if the expiration date has not been reached |
154 | 154 | if ($uData['expiration_date']>date('Y-m-d H:i:s') OR $uData['expiration_date']=='0000-00-00 00:00:00') { |
155 | 155 | return "valid"; |
156 | + } else { |
|
157 | + return get_lang('AccountExpired'); |
|
156 | 158 | } |
157 | - else |
|
158 | - return get_lang('AccountExpired'); |
|
159 | + } else { |
|
160 | + return get_lang('AccountInactive'); |
|
159 | 161 | } |
160 | - else |
|
161 | - return get_lang('AccountInactive'); |
|
162 | + } else { |
|
163 | + return get_lang('InvalidId'); |
|
162 | 164 | } |
163 | - else |
|
164 | - return get_lang('InvalidId'); |
|
165 | + } else { |
|
166 | + return get_lang('AccountURLInactive'); |
|
165 | 167 | } |
166 | - else |
|
167 | - return get_lang('AccountURLInactive'); |
|
168 | 168 | } |
169 | 169 | return get_lang('InvalidId'); |
170 | 170 | } |
@@ -48,8 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | return $message; |
50 | 50 | |
51 | - } else |
|
52 | - return get_lang('InvalidId'); |
|
51 | + } else { |
|
52 | + return get_lang('InvalidId'); |
|
53 | + } |
|
53 | 54 | |
54 | 55 | } |
55 | 56 | |
@@ -92,8 +93,9 @@ discard block |
||
92 | 93 | $result = Database::fetch_row($sql_result); |
93 | 94 | return (htmlcode) ? html_entity_decode($result[0]) : $result[0]; |
94 | 95 | |
95 | - }else |
|
96 | - return get_lang('InvalidId'); |
|
96 | + } else { |
|
97 | + return get_lang('InvalidId'); |
|
98 | + } |
|
97 | 99 | |
98 | 100 | |
99 | 101 | } |
@@ -118,8 +120,9 @@ discard block |
||
118 | 120 | |
119 | 121 | return $message; |
120 | 122 | |
121 | - } else |
|
122 | - return get_lang('InvalidId'); |
|
123 | + } else { |
|
124 | + return get_lang('InvalidId'); |
|
125 | + } |
|
123 | 126 | |
124 | 127 | } |
125 | 128 | |
@@ -164,8 +167,9 @@ discard block |
||
164 | 167 | |
165 | 168 | return (htmlcode) ? html_entity_decode($result[0]) : $result[0]; |
166 | 169 | |
167 | - }else |
|
168 | - return get_lang('InvalidId'); |
|
170 | + } else { |
|
171 | + return get_lang('InvalidId'); |
|
172 | + } |
|
169 | 173 | |
170 | 174 | |
171 | 175 | } |
@@ -199,8 +203,9 @@ discard block |
||
199 | 203 | |
200 | 204 | return $inbox_last_id; |
201 | 205 | |
202 | - } else |
|
203 | - return get_lang('InvalidId'); |
|
206 | + } else { |
|
207 | + return get_lang('InvalidId'); |
|
208 | + } |
|
204 | 209 | |
205 | 210 | } |
206 | 211 |
@@ -87,10 +87,11 @@ |
||
87 | 87 | |
88 | 88 | $is_certificate_mode = DocumentManager::is_certificate_mode($dir); |
89 | 89 | |
90 | -if (!$is_certificate_mode) |
|
90 | +if (!$is_certificate_mode) { |
|
91 | 91 | $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).$req_gid, "name"=> get_lang('Documents')); |
92 | -else |
|
92 | +} else { |
|
93 | 93 | $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
94 | +} |
|
94 | 95 | |
95 | 96 | // Interbreadcrumb for the current directory root path |
96 | 97 | if (empty($document_data['parents'])) { |
@@ -381,7 +381,9 @@ discard block |
||
381 | 381 | //prevent duplicates |
382 | 382 | if (file_exists($filepath.'/'.$clean_title.'.'.$extension)){ |
383 | 383 | $i = 1; |
384 | - while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) $i++; |
|
384 | + while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) { |
|
385 | + $i++; |
|
386 | + } |
|
385 | 387 | $audio_filename = $clean_title . '_' . $i . '.'.$extension; |
386 | 388 | $audio_title = $clean_title . '_' . $i . '.'.$extension; |
387 | 389 | $audio_title = str_replace('_',' ',$audio_title); |
@@ -491,7 +493,9 @@ discard block |
||
491 | 493 | //prevent duplicates |
492 | 494 | if (file_exists($filepath.'/'.$clean_title.'.'.$extension)){ |
493 | 495 | $i = 1; |
494 | - while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) $i++; |
|
496 | + while (file_exists($filepath.'/'.$clean_title.'_'.$i.'.'.$extension)) { |
|
497 | + $i++; |
|
498 | + } |
|
495 | 499 | $audio_filename = $clean_title . '_' . $i . '.'.$extension; |
496 | 500 | $audio_title = $clean_title . '_' . $i . '.'.$extension; |
497 | 501 | $audio_title = str_replace('_',' ',$audio_title); |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | $webcamname = $params['webcamname']; |
18 | 18 | $webcamdir = $params['webcamdir']; |
19 | 19 | $webcamuserid = $params['webcamuserid']; |
20 | -} |
|
21 | -else { |
|
20 | +} else { |
|
22 | 21 | api_not_allowed(); |
23 | 22 | die(); |
24 | 23 | } |
@@ -58,7 +57,9 @@ discard block |
||
58 | 57 | $webcamname_noex=basename($webcamname, ".jpg"); |
59 | 58 | if (file_exists($saveDir.'/'.$webcamname_noex.'.'.$ext)){ |
60 | 59 | $i = 1; |
61 | - while (file_exists($saveDir.'/'.$webcamname_noex.'_'.$i.'.'.$ext)) $i++; |
|
60 | + while (file_exists($saveDir.'/'.$webcamname_noex.'_'.$i.'.'.$ext)) { |
|
61 | + $i++; |
|
62 | + } |
|
62 | 63 | $webcamname_to_save = $webcamname_noex . '_' . $i . '.'.$ext; |
63 | 64 | $title_to_save = $webcamname_noex . '_' . $i . '.'.$ext; |
64 | 65 | $title_to_save = str_replace('_',' ',$title_to_save); |
@@ -93,10 +93,11 @@ discard block |
||
93 | 93 | |
94 | 94 | $is_certificate_mode = DocumentManager::is_certificate_mode($dir); |
95 | 95 | |
96 | -if (!$is_certificate_mode) |
|
96 | +if (!$is_certificate_mode) { |
|
97 | 97 | $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents')); |
98 | -else |
|
98 | +} else { |
|
99 | 99 | $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
100 | +} |
|
100 | 101 | |
101 | 102 | // Interbreadcrumb for the current directory root path |
102 | 103 | if (empty($document_data['parents'])) { |
@@ -158,8 +159,7 @@ discard block |
||
158 | 159 | @file_put_contents($path_and_file, $crossdomain); |
159 | 160 | } |
160 | 161 | $credentials="true"; |
161 | -} |
|
162 | -else { |
|
162 | +} else { |
|
163 | 163 | $credentials="false"; |
164 | 164 | } |
165 | 165 |
@@ -124,7 +124,9 @@ discard block |
||
124 | 124 | |
125 | 125 | if (file_exists($saveDir.'/'.$filename.'.'.$extension)){ |
126 | 126 | $i = 1; |
127 | - while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) $i++; |
|
127 | + while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) { |
|
128 | + $i++; |
|
129 | + } |
|
128 | 130 | $paintFileName = $filename . '_' . $i . '.'.$extension; |
129 | 131 | $title = $filename . '_' . $i . '.'.$extension; |
130 | 132 | } |
@@ -137,7 +139,7 @@ discard block |
||
137 | 139 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
138 | 140 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
139 | 141 | |
140 | -}elseif($currentTool=='document/editpaint'){ |
|
142 | +} elseif($currentTool=='document/editpaint'){ |
|
141 | 143 | |
142 | 144 | $documentPath = $saveDir.'/'.$paintFileName; |
143 | 145 | //add new document to disk |
@@ -152,7 +154,7 @@ discard block |
||
152 | 154 | $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$paintFileName); |
153 | 155 | update_existing_document($_course, $document_id, filesize($documentPath), null); |
154 | 156 | api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
155 | - }else{ |
|
157 | + } else{ |
|
156 | 158 | //add a new document |
157 | 159 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
158 | 160 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
@@ -561,8 +561,9 @@ |
||
561 | 561 | } |
562 | 562 | $dir= substr($dir,0,-1); |
563 | 563 | $selectcat = ''; |
564 | - if (isset($_REQUEST['selectcat'])) |
|
565 | - $selectcat = "&selectcat=".Security::remove_XSS($_REQUEST['selectcat']); |
|
564 | + if (isset($_REQUEST['selectcat'])) { |
|
565 | + $selectcat = "&selectcat=".Security::remove_XSS($_REQUEST['selectcat']); |
|
566 | + } |
|
566 | 567 | $certificate_condition = ''; |
567 | 568 | if ($is_certificate_mode) { |
568 | 569 | $df = DocumentManager::get_default_certificate_id($_course['code']); |
@@ -40,7 +40,9 @@ |
||
40 | 40 | $user_id = api_get_user_id(); |
41 | 41 | $coursePath = api_get_path(SYS_COURSE_PATH).$cidReq.'/document'; |
42 | 42 | $_course = CourseManager::get_course_information($cidReq); |
43 | -if ($_course == null) die ("problem when fetching course information"); |
|
43 | +if ($_course == null) { |
|
44 | + die ("problem when fetching course information"); |
|
45 | +} |
|
44 | 46 | // stupid variable initialisation for old version of DocumentManager functions. |
45 | 47 | $_course['path'] = $_course['directory']; |
46 | 48 | $is_manager = (CourseManager::get_user_in_course_status($user_id, $cidReq) == COURSEMANAGER); |