Completed
Push — 1.11.x ( d4cbce...fbf9a8 )
by José
48:27
created
main/dropbox/dropbox_submit.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -33,21 +33,21 @@  discard block
 block discarded – undo
33 33
         $thisIsAMailing = false;
34 34
         $thisIsJustUpload = false;
35 35
 
36
-	    foreach ($_POST['recipients'] as $rec) {
36
+        foreach ($_POST['recipients'] as $rec) {
37 37
             if ($rec == 'mailing') {
38
-	            $thisIsAMailing = true;
38
+                $thisIsAMailing = true;
39 39
             } elseif ($rec == 'upload') {
40
-	            $thisIsJustUpload = true;
40
+                $thisIsJustUpload = true;
41 41
             } elseif (strpos($rec, 'user_') === 0 && !isCourseMember(substr($rec, strlen('user_')))) {
42
-	        	echo '401';
43
-	        	die(get_lang('BadFormData').' (code 401)');
44
-	        } elseif (strpos($rec, 'group_') !== 0 && strpos($rec, 'user_') !== 0) {
45
-	        	echo '402';
46
-	        	die(get_lang('BadFormData').' (code 402)');
47
-	        }
42
+                echo '401';
43
+                die(get_lang('BadFormData').' (code 401)');
44
+            } elseif (strpos($rec, 'group_') !== 0 && strpos($rec, 'user_') !== 0) {
45
+                echo '402';
46
+                die(get_lang('BadFormData').' (code 402)');
47
+            }
48 48
         }
49 49
 
50
-		// we are doing a mailing but an additional recipient is selected
50
+        // we are doing a mailing but an additional recipient is selected
51 51
         if ($thisIsAMailing && ( count($_POST['recipients']) != 1)) {
52 52
             $error = true;
53 53
             $errormsg = get_lang('MailingSelectNoOther');
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
         }
63 63
     }
64 64
 
65
-	//check if $_POST['cb_overwrite'] is true or false
66
-	$dropbox_overwrite = false;
67
-	if (isset($_POST['cb_overwrite']) && $_POST['cb_overwrite']) {
68
-		$dropbox_overwrite = true;
69
-	}
65
+    //check if $_POST['cb_overwrite'] is true or false
66
+    $dropbox_overwrite = false;
67
+    if (isset($_POST['cb_overwrite']) && $_POST['cb_overwrite']) {
68
+        $dropbox_overwrite = true;
69
+    }
70 70
 
71 71
     /**
72 72
      * FORM SUBMIT : UPLOAD NEW FILE
@@ -168,13 +168,13 @@  discard block
 block discarded – undo
168 168
                     }
169 169
                 }
170 170
 
171
-				// After uploading the file, create the db entries
171
+                // After uploading the file, create the db entries
172 172
 
173
-	        	if (!$error) {
174
-		            @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename)
175
-		            	or die(get_lang('UploadError').' (code 407)');
176
-		            new Dropbox_SentWork($_user['user_id'], $dropbox_title, $_POST['description'], strip_tags($_POST['authors']), $dropbox_filename, $dropbox_filesize, $newWorkRecipients);
177
-	        	}
173
+                if (!$error) {
174
+                    @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename)
175
+                        or die(get_lang('UploadError').' (code 407)');
176
+                    new Dropbox_SentWork($_user['user_id'], $dropbox_title, $_POST['description'], strip_tags($_POST['authors']), $dropbox_filename, $dropbox_filesize, $newWorkRecipients);
177
+                }
178 178
             }
179 179
         }
180 180
     } //end if(!$error)
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
      * SUBMIT FORM RESULTMESSAGE
184 184
      */
185 185
     if (!$error) {
186
-		$return_message = get_lang('FileUploadSucces');
186
+        $return_message = get_lang('FileUploadSucces');
187 187
     } else {
188
-		$return_message = $errormsg;
188
+        $return_message = $errormsg;
189 189
     }
190 190
 }
191 191
 
@@ -199,25 +199,25 @@  discard block
 block discarded – undo
199 199
  */
200 200
 if (isset($_GET['deleteReceived']) || isset($_GET['deleteSent'])
201 201
          || isset( $_GET['showFeedback']) || isset( $_GET['editFeedback'])) {
202
-	if ($_GET['mailing']) {
203
-		getUserOwningThisMailing($_GET['mailing'], $_user['user_id'], '408');
204
-		$dropbox_person = new Dropbox_Person($_GET['mailing'], $is_courseAdmin, $is_courseTutor);
205
-	} else {
206
-	    $dropbox_person = new Dropbox_Person($_user['user_id'], $is_courseAdmin, $is_courseTutor);
202
+    if ($_GET['mailing']) {
203
+        getUserOwningThisMailing($_GET['mailing'], $_user['user_id'], '408');
204
+        $dropbox_person = new Dropbox_Person($_GET['mailing'], $is_courseAdmin, $is_courseTutor);
205
+    } else {
206
+        $dropbox_person = new Dropbox_Person($_user['user_id'], $is_courseAdmin, $is_courseTutor);
207 207
     }
208 208
 
209
-	if (isset($_SESSION['sentOrder'])) {
210
-		$dropbox_person->orderSentWork($_SESSION['sentOrder']);
211
-	}
212
-	if (isset($_SESSION['receivedOrder'])) {
213
-		$dropbox_person->orderReceivedWork($_SESSION['receivedOrder']);
214
-	}
209
+    if (isset($_SESSION['sentOrder'])) {
210
+        $dropbox_person->orderSentWork($_SESSION['sentOrder']);
211
+    }
212
+    if (isset($_SESSION['receivedOrder'])) {
213
+        $dropbox_person->orderReceivedWork($_SESSION['receivedOrder']);
214
+    }
215 215
 
216
-	/*if (!$dropbox_person->isCourseAdmin || ! $dropbox_person->isCourseTutor) {
216
+    /*if (!$dropbox_person->isCourseAdmin || ! $dropbox_person->isCourseTutor) {
217 217
 	    die(get_lang('GeneralError').' (code 408)');
218 218
 	}*/
219 219
 
220
-	$tellUser = get_lang('FileDeleted');
220
+    $tellUser = get_lang('FileDeleted');
221 221
 
222 222
     if (isset($_GET['deleteReceived'])) {
223 223
         if ($_GET['deleteReceived'] == 'all') {
@@ -236,20 +236,20 @@  discard block
 block discarded – undo
236 236
             die(get_lang('GeneralError').' (code 410)');
237 237
         }
238 238
     } elseif (isset($_GET['showFeedback'])) {
239
-		$w = new Dropbox_SentWork($id = $_GET['showFeedback']);
239
+        $w = new Dropbox_SentWork($id = $_GET['showFeedback']);
240 240
 
241
-		if ($w->uploader_id != $_user['user_id']) {
242
-		    getUserOwningThisMailing($w->uploader_id, $_user['user_id'], '411');
243
-		}
241
+        if ($w->uploader_id != $_user['user_id']) {
242
+            getUserOwningThisMailing($w->uploader_id, $_user['user_id'], '411');
243
+        }
244 244
 
245
-    	foreach ($w -> recipients as $r) {
246
-    		if (($fb = $r['feedback'])) {
247
-    			$fbarray[$r['feedback_date'].$r['name']] = $r['name'].' '.get_lang('SentOn', '').' '.$r['feedback_date'].":\n".$fb;
248
-    		}
249
-    	}
245
+        foreach ($w -> recipients as $r) {
246
+            if (($fb = $r['feedback'])) {
247
+                $fbarray[$r['feedback_date'].$r['name']] = $r['name'].' '.get_lang('SentOn', '').' '.$r['feedback_date'].":\n".$fb;
248
+            }
249
+        }
250 250
 
251
-    	if ($fbarray) {
252
-        	krsort($fbarray);
251
+        if ($fbarray) {
252
+            krsort($fbarray);
253 253
             echo '<textarea class="dropbox_feedbacks">',
254 254
                     htmlspecialchars(implode("\n\n", $fbarray), ENT_QUOTES, api_get_system_encoding()), '</textarea>', "\n";
255 255
         } else {
@@ -261,13 +261,13 @@  discard block
 block discarded – undo
261 261
     } else { // if ( isset( $_GET['editFeedback'])) {
262 262
         $id = $_GET['editFeedback'];
263 263
         $found = false;
264
-		foreach ($dropbox_person->receivedWork as $w) {
265
-			if ($w->id == $id) {
266
-			   $found = true;
267
-			   break;
268
-			}
269
-		}
270
-		if (!$found) die(get_lang('GeneralError').' (code 415)');
264
+        foreach ($dropbox_person->receivedWork as $w) {
265
+            if ($w->id == $id) {
266
+                $found = true;
267
+                break;
268
+            }
269
+        }
270
+        if (!$found) die(get_lang('GeneralError').' (code 415)');
271 271
 
272 272
         echo '<form method="post" action="index.php">', "\n",
273 273
             '<input type="hidden" name="feedbackid" value="',
Please login to merge, or discard this patch.
main/dropbox/dropbox_functions.inc.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,11 +83,11 @@
 block discarded – undo
83 83
     if (strstr($_POST['action'], 'move_')) {
84 84
         // check move_received_n or move_sent_n command
85 85
         if (strstr($_POST['action'], 'received')) {
86
-              $part = 'received';
87
-              $to_cat_id = str_replace('move_received_', '', $_POST['action']);
86
+                $part = 'received';
87
+                $to_cat_id = str_replace('move_received_', '', $_POST['action']);
88 88
         } else {
89
-              $part = 'sent';
90
-              $to_cat_id = str_replace('move_sent_', '', $_POST['action']);
89
+                $part = 'sent';
90
+                $to_cat_id = str_replace('move_sent_', '', $_POST['action']);
91 91
         }
92 92
 
93 93
         foreach ($checked_file_ids as $value) {
Please login to merge, or discard this patch.
main/cron/document/index_all_docs.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@  discard block
 block discarded – undo
8 8
 die();
9 9
 require '../../inc/global.inc.php';
10 10
 if (empty($_GET['doc'])) {
11
-  echo "To add a document name to search, add ?doc=abc to the URL\n";
11
+    echo "To add a document name to search, add ?doc=abc to the URL\n";
12 12
 } else {
13
-  echo "Received param ".$_GET['doc']."<br />\n";
13
+    echo "Received param ".$_GET['doc']."<br />\n";
14 14
 }
15 15
 $allowed_mime_types = DocumentManager::file_get_mime_type(true);
16 16
 $allowed_extensions = array(
@@ -40,30 +40,30 @@  discard block
 block discarded – undo
40 40
 $specific_fields = get_specific_field_list();
41 41
 $specific_fields_values = array();
42 42
 foreach ($specific_fields as $sf) {
43
-	$specific_fields_values[$sf['code']] = '';
43
+    $specific_fields_values[$sf['code']] = '';
44 44
 }
45 45
 $td = Database::get_course_table(TABLE_DOCUMENT);
46 46
 
47 47
 foreach ($courses_list as $course) {
48
-  $course_dir = $course['directory'].'/document';
49
-  $title = Database::escape_string($_GET['doc']);
50
-  $sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'";
51
-  $res = Database::query($sql);
52
-  if (Database::num_rows($res)>0) {
48
+    $course_dir = $course['directory'].'/document';
49
+    $title = Database::escape_string($_GET['doc']);
50
+    $sql = "SELECT id, path, session_id FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' or title LIKE '%$title%'";
51
+    $res = Database::query($sql);
52
+    if (Database::num_rows($res)>0) {
53 53
     while ($row = Database::fetch_array($res)) {
54
-      $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
55
-      $extensions = preg_split("/[\/\\.]/", $doc_path);
56
-      $doc_ext = strtolower($extensions[count($extensions) - 1]);
57
-      if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) {
54
+        $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
55
+        $extensions = preg_split("/[\/\\.]/", $doc_path);
56
+        $doc_ext = strtolower($extensions[count($extensions) - 1]);
57
+        if (in_array($doc_ext, $allowed_extensions) && !is_dir($doc_path)) {
58 58
         $doc_mime = mime_content_type($doc_path);
59 59
         echo "Indexing doc ".$row['id']." (".$row['path'].") in course ".$course['code']."\n";
60 60
         $residx = DocumentManager::index_document($row['id'], $course['code'], $row['session_id'], $course['course_language'], $specific_fields_values);
61 61
         if ($residx) {
62
-        	echo "Success\n";
62
+            echo "Success\n";
63 63
         } else {
64
-        	echo "Failure\n";
64
+            echo "Failure\n";
65 65
         }
66
-      }
66
+        }
67
+    }
67 68
     }
68
-  }
69 69
 }
Please login to merge, or discard this patch.
main/dashboard/dashboard.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,23 +14,23 @@  discard block
 block discarded – undo
14 14
 $views = array('blocks', 'list');
15 15
 
16 16
 if(isset($_GET['view']) && in_array($_GET['view'], $views)){
17
-	$dashboard_view = $_GET['view'];
17
+    $dashboard_view = $_GET['view'];
18 18
 }
19 19
 
20 20
 $link_blocks_view = $link_list_view = null;
21 21
 
22 22
 if (isset($dashboard_view) && $dashboard_view == 'list') {
23
-	$link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.
24
-		Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
23
+    $link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.
24
+        Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
25 25
 } else {
26
-	$link_list_view = '<a href="'.api_get_self().'?view=list">'.
27
-		Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
26
+    $link_list_view = '<a href="'.api_get_self().'?view=list">'.
27
+        Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
28 28
 }
29 29
 
30 30
 $configuration_link = null;
31 31
 if (api_is_platform_admin()) {
32
-	$configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
33
-	.Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
32
+    $configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
33
+    .Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
34 34
 }
35 35
 
36 36
 echo '<div class="actions">';
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
     }
88 88
 
89 89
 } else {
90
-	// block dashboard list
91
-	if (isset($success)) {
92
-		Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'));
93
-	}
94
-	$user_id = api_get_user_id();
95
-	DashboardManager::display_user_dashboard_list($user_id);
90
+    // block dashboard list
91
+    if (isset($success)) {
92
+        Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'));
93
+    }
94
+    $user_id = api_get_user_id();
95
+    DashboardManager::display_user_dashboard_list($user_id);
96 96
 }
Please login to merge, or discard this patch.
main/blog/download.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
 $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
34 34
 
35 35
 if (! isset($_course)) {
36
-	api_not_allowed(true);
36
+    api_not_allowed(true);
37 37
 }
38 38
 $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url;
39 39
 
40 40
 //if the rewrite rule asks for a directory, we redirect to the course view
41 41
 if (is_dir($full_file_name)) {
42
-	//remove last slash if present
43
-	while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
44
-	//create the path
45
-	$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
46
-	//redirect
47
-	header('Location: '.$document_explorer);
42
+    //remove last slash if present
43
+    while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
44
+    //create the path
45
+    $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
46
+    //redirect
47
+    header('Location: '.$document_explorer);
48 48
     exit;
49 49
 }
50 50
 
Please login to merge, or discard this patch.
main/gradebook/gradebook_display_certificate.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -162,17 +162,17 @@
 block discarded – undo
162 162
 
163 163
     if ($form->validate()) {
164 164
         $officialCode = $form->getSubmitValue('filter');
165
-         if ($officialCode == 'all') {
165
+            if ($officialCode == 'all') {
166 166
             $certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
167 167
         } else {
168
-             $userList = UserManager::getUsersByOfficialCode($officialCode);
169
-             if (!empty($userList)) {
170
-                 $certificate_list = GradebookUtils::get_list_users_certificates(
171
-                     $cat_id,
172
-                     $userList
173
-                 );
174
-             }
175
-         }
168
+                $userList = UserManager::getUsersByOfficialCode($officialCode);
169
+                if (!empty($userList)) {
170
+                    $certificate_list = GradebookUtils::get_list_users_certificates(
171
+                        $cat_id,
172
+                        $userList
173
+                    );
174
+                }
175
+            }
176 176
     } else {
177 177
         $certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
178 178
     }
Please login to merge, or discard this patch.
main/gradebook/lib/fe/displaygradebook.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -558,7 +558,7 @@
 block discarded – undo
558 558
                     $my_api_cidreq = 'cidReq=' . $my_category['course_code'];
559 559
                 }
560 560
                 if ($show_add_link && !$message_resource) {
561
-                   $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' .
561
+                    $actionsLeft .= '<a href="gradebook_add_eval.php?' . $my_api_cidreq . '&selectcat=' . $catobj->get_id() . '" >' .
562 562
                         Display::return_icon('new_evaluation.png', get_lang('NewEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>';
563 563
                     $cats = Category :: load($selectcat);
564 564
 
Please login to merge, or discard this patch.
main/gradebook/lib/be/exerciselink.class.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
         in exercice/exercice.php, look for note-query-exe-results marker*/
195 195
         $session_id = api_get_session_id();
196 196
         $courseId = $this->getCourseId();
197
-	    $exercise = new Exercise($courseId);
197
+        $exercise = new Exercise($courseId);
198 198
         $exercise->read($this->get_ref_id());
199 199
 
200 200
         if (!$this->is_hp) {
201 201
 
202
-		if ($exercise->exercise_was_added_in_lp == false) {
203
-			$sql = "SELECT * FROM $tblStats
202
+        if ($exercise->exercise_was_added_in_lp == false) {
203
+            $sql = "SELECT * FROM $tblStats
204 204
 			        WHERE
205 205
 			            exe_exo_id = ".intval($this->get_ref_id())." AND
206 206
 			            orig_lp_id = 0 AND
@@ -209,15 +209,15 @@  discard block
 block discarded – undo
209 209
 			            session_id = $session_id AND
210 210
                                     c_id = $courseId 
211 211
                                 ";
212
-		    } else {
213
-		        $lpId = null;
214
-		        if (!empty($exercise->lpList)) {
215
-		            // Taking only the first LP
216
-		            $lpId = current($exercise->lpList);
217
-		            $lpId = $lpId['lp_id'];
218
-		        }
219
-
220
-		        $sql = "SELECT * FROM $tblStats
212
+            } else {
213
+                $lpId = null;
214
+                if (!empty($exercise->lpList)) {
215
+                    // Taking only the first LP
216
+                    $lpId = current($exercise->lpList);
217
+                    $lpId = $lpId['lp_id'];
218
+                }
219
+
220
+                $sql = "SELECT * FROM $tblStats
221 221
 		                WHERE
222 222
 		                    exe_exo_id = ".intval($this->get_ref_id())." AND
223 223
 		                    orig_lp_id = $lpId AND
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		                    session_id = $session_id AND
226 226
                                     c_id = $courseId 
227 227
                                 ";
228
-		    }
228
+            }
229 229
 
230 230
             if (!empty($stud_id) && $type != 'ranking') {
231 231
                 $sql .= " AND exe_user_id = $stud_id ";
Please login to merge, or discard this patch.
main/gradebook/lib/be/gradebookitem.class.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@
 block discarded – undo
8 8
  */
9 9
 interface GradebookItem
10 10
 {
11
-	public function get_item_type();
12
-	public function get_id();
13
-	public function get_name();
14
-	public function get_description();
15
-	public function get_course_code();
16
-	public function get_weight();
17
-	public function get_date();
18
-	public function is_visible();
19
-	public function get_icon_name();
20
-	public function getStudentList();
21
-	public function setStudentList($list);
22
-	public function calc_score($stud_id = null, $type = null);
11
+    public function get_item_type();
12
+    public function get_id();
13
+    public function get_name();
14
+    public function get_description();
15
+    public function get_course_code();
16
+    public function get_weight();
17
+    public function get_date();
18
+    public function is_visible();
19
+    public function get_icon_name();
20
+    public function getStudentList();
21
+    public function setStudentList($list);
22
+    public function calc_score($stud_id = null, $type = null);
23 23
 }
Please login to merge, or discard this patch.