@@ -666,7 +666,7 @@ |
||
666 | 666 | $res = Database::query($sql); |
667 | 667 | $count1 = Database::fetch_object($res); |
668 | 668 | $sql = "SELECT COUNT(*) AS n FROM $user_table as u $table ". |
669 | - "WHERE LENGTH(picture_uri) > 0 $url_condition2"; |
|
669 | + "WHERE LENGTH(picture_uri) > 0 $url_condition2"; |
|
670 | 670 | $res = Database::query($sql); |
671 | 671 | $count2 = Database::fetch_object($res); |
672 | 672 | // #users without picture |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | |
19 | 19 | class OpenGraph implements Iterator |
20 | 20 | { |
21 | - /** |
|
22 | - * There are base schema's based on type, this is just |
|
23 | - * a map so that the schema can be obtained |
|
24 | - * |
|
25 | - */ |
|
21 | + /** |
|
22 | + * There are base schema's based on type, this is just |
|
23 | + * a map so that the schema can be obtained |
|
24 | + * |
|
25 | + */ |
|
26 | 26 | public static $TYPES = array( |
27 | 27 | 'activity' => array('activity', 'sport'), |
28 | 28 | 'business' => array('bar', 'company', 'cafe', 'hotel', 'restaurant'), |
@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | 'website' => array('blog', 'website'), |
35 | 35 | ); |
36 | 36 | |
37 | - /** |
|
38 | - * Holds all the Open Graph values we've parsed from a page |
|
39 | - * |
|
40 | - */ |
|
37 | + /** |
|
38 | + * Holds all the Open Graph values we've parsed from a page |
|
39 | + * |
|
40 | + */ |
|
41 | 41 | private $_values = array(); |
42 | 42 | |
43 | - /** |
|
44 | - * Fetches a URI and parses it for Open Graph data, returns |
|
45 | - * false on error. |
|
46 | - * |
|
47 | - * @param $URI URI to page to parse for Open Graph data |
|
48 | - * @return OpenGraph |
|
49 | - */ |
|
43 | + /** |
|
44 | + * Fetches a URI and parses it for Open Graph data, returns |
|
45 | + * false on error. |
|
46 | + * |
|
47 | + * @param $URI URI to page to parse for Open Graph data |
|
48 | + * @return OpenGraph |
|
49 | + */ |
|
50 | 50 | static public function fetch($URI) { |
51 | 51 | $curl = curl_init($URI); |
52 | 52 | |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - /** |
|
73 | - * Parses HTML and extracts Open Graph data, this assumes |
|
74 | - * the document is at least well formed. |
|
75 | - * |
|
76 | - * @param $HTML HTML to parse |
|
77 | - * @return OpenGraph |
|
78 | - */ |
|
72 | + /** |
|
73 | + * Parses HTML and extracts Open Graph data, this assumes |
|
74 | + * the document is at least well formed. |
|
75 | + * |
|
76 | + * @param $HTML HTML to parse |
|
77 | + * @return OpenGraph |
|
78 | + */ |
|
79 | 79 | static private function _parse($HTML) { |
80 | 80 | $old_libxml_error = libxml_use_internal_errors(true); |
81 | 81 | |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | return $page; |
141 | 141 | } |
142 | 142 | |
143 | - /** |
|
144 | - * Helper method to access attributes directly |
|
145 | - * Example: |
|
146 | - * $graph->title |
|
147 | - * |
|
148 | - * @param $key Key to fetch from the lookup |
|
149 | - */ |
|
143 | + /** |
|
144 | + * Helper method to access attributes directly |
|
145 | + * Example: |
|
146 | + * $graph->title |
|
147 | + * |
|
148 | + * @param $key Key to fetch from the lookup |
|
149 | + */ |
|
150 | 150 | public function __get($key) { |
151 | 151 | if (array_key_exists($key, $this->_values)) { |
152 | 152 | return $this->_values[$key]; |
@@ -161,29 +161,29 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | - /** |
|
165 | - * Return all the keys found on the page |
|
166 | - * |
|
167 | - * @return array |
|
168 | - */ |
|
164 | + /** |
|
165 | + * Return all the keys found on the page |
|
166 | + * |
|
167 | + * @return array |
|
168 | + */ |
|
169 | 169 | public function keys() { |
170 | 170 | return array_keys($this->_values); |
171 | 171 | } |
172 | 172 | |
173 | - /** |
|
174 | - * Helper method to check an attribute exists |
|
175 | - * |
|
176 | - * @param $key |
|
177 | - */ |
|
173 | + /** |
|
174 | + * Helper method to check an attribute exists |
|
175 | + * |
|
176 | + * @param $key |
|
177 | + */ |
|
178 | 178 | public function __isset($key) { |
179 | 179 | return array_key_exists($key, $this->_values); |
180 | 180 | } |
181 | 181 | |
182 | - /** |
|
183 | - * Will return true if the page has location data embedded |
|
184 | - * |
|
185 | - * @return boolean Check if the page has location data |
|
186 | - */ |
|
182 | + /** |
|
183 | + * Will return true if the page has location data embedded |
|
184 | + * |
|
185 | + * @return boolean Check if the page has location data |
|
186 | + */ |
|
187 | 187 | public function hasLocation() { |
188 | 188 | if (array_key_exists('latitude', $this->_values) && array_key_exists('longitude', $this->_values)) { |
189 | 189 | return true; |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | return $valid_address; |
198 | 198 | } |
199 | 199 | |
200 | - /** |
|
201 | - * Iterator code |
|
202 | - */ |
|
200 | + /** |
|
201 | + * Iterator code |
|
202 | + */ |
|
203 | 203 | private $_position = 0; |
204 | 204 | public function rewind() { reset($this->_values); $this->_position = 0; } |
205 | 205 | public function current() { return current($this->_values); } |
@@ -379,7 +379,7 @@ |
||
379 | 379 | $sql_delete = "DELETE FROM $tucc |
380 | 380 | WHERE id='" . $category_id . "' and user_id='" . $current_user_id . "'"; |
381 | 381 | $resultQuery = Database::query($sql_delete); |
382 | - if (Database::affected_rows($resultQuery)) { |
|
382 | + if (Database::affected_rows($resultQuery)) { |
|
383 | 383 | $result = true; |
384 | 384 | } |
385 | 385 | $sql = "UPDATE $TABLECOURSUSER |
@@ -107,14 +107,14 @@ |
||
107 | 107 | return $resu; |
108 | 108 | } |
109 | 109 | |
110 | - /** |
|
111 | - * @author Sebastien Piraux <[email protected]> |
|
112 | - * @param sql : a sql query (as a string) |
|
113 | - * @return hours_array |
|
114 | - * @desc Return an assoc array. Keys are the hours, values are |
|
115 | - * the number of time this hours was found. |
|
116 | - * key 'total' return the sum of all number of time hours |
|
117 | - * appear |
|
110 | + /** |
|
111 | + * @author Sebastien Piraux <[email protected]> |
|
112 | + * @param sql : a sql query (as a string) |
|
113 | + * @return hours_array |
|
114 | + * @desc Return an assoc array. Keys are the hours, values are |
|
115 | + * the number of time this hours was found. |
|
116 | + * key 'total' return the sum of all number of time hours |
|
117 | + * appear |
|
118 | 118 | */ |
119 | 119 | public static function hoursTab($sql) |
120 | 120 | { |
@@ -5,42 +5,42 @@ |
||
5 | 5 | * @deprecated Don't use this class |
6 | 6 | */ |
7 | 7 | class Rights { |
8 | - private static $rights_cache = array(); |
|
9 | - private static $rights = array ( |
|
10 | - 'show_tabs:reports' => |
|
11 | - array ( |
|
12 | - 'type' => 'const', |
|
13 | - 'const' => 'true' ) |
|
14 | - ); |
|
8 | + private static $rights_cache = array(); |
|
9 | + private static $rights = array ( |
|
10 | + 'show_tabs:reports' => |
|
11 | + array ( |
|
12 | + 'type' => 'const', |
|
13 | + 'const' => 'true' ) |
|
14 | + ); |
|
15 | 15 | |
16 | - // warning the goal of this function is to enforce rights managment in Chamilo |
|
17 | - // thus default return value is always true |
|
18 | - public static function hasRight($handler) { |
|
19 | - if (array_key_exists($handler, self::$rights_cache)) |
|
20 | - return self::$rights_cache[$handler]; |
|
16 | + // warning the goal of this function is to enforce rights managment in Chamilo |
|
17 | + // thus default return value is always true |
|
18 | + public static function hasRight($handler) { |
|
19 | + if (array_key_exists($handler, self::$rights_cache)) |
|
20 | + return self::$rights_cache[$handler]; |
|
21 | 21 | |
22 | - if (!array_key_exists($handler, self::$rights)) |
|
23 | - return true; // handler does not exists |
|
22 | + if (!array_key_exists($handler, self::$rights)) |
|
23 | + return true; // handler does not exists |
|
24 | 24 | |
25 | - if (self::$rights[$handler]['type'] == 'sql') { |
|
26 | - $result = Database::query(self::$rights[$handler]['sql']); |
|
27 | - if (Database::num_rows($result) > 0) |
|
28 | - $result = true; |
|
29 | - else |
|
30 | - $result = false; |
|
31 | - } else if (self::$rights[$handler]['type'] == 'const') |
|
32 | - $result = self::$rights[$handler]['const']; |
|
33 | - else if (self::$rights[$handler]['type'] == 'func') |
|
34 | - $result = self::$rights[$handler]['func'](); |
|
35 | - else // handler type not implemented |
|
36 | - return true; |
|
37 | - self::$rights_cache[$handler] = $result; |
|
38 | - return $result; |
|
39 | - } |
|
25 | + if (self::$rights[$handler]['type'] == 'sql') { |
|
26 | + $result = Database::query(self::$rights[$handler]['sql']); |
|
27 | + if (Database::num_rows($result) > 0) |
|
28 | + $result = true; |
|
29 | + else |
|
30 | + $result = false; |
|
31 | + } else if (self::$rights[$handler]['type'] == 'const') |
|
32 | + $result = self::$rights[$handler]['const']; |
|
33 | + else if (self::$rights[$handler]['type'] == 'func') |
|
34 | + $result = self::$rights[$handler]['func'](); |
|
35 | + else // handler type not implemented |
|
36 | + return true; |
|
37 | + self::$rights_cache[$handler] = $result; |
|
38 | + return $result; |
|
39 | + } |
|
40 | 40 | |
41 | - public static function hasRightClosePageWithError($handler) { |
|
42 | - if (hasRight($handler) == false) |
|
43 | - die("You are not allowed here"); //FIXME |
|
44 | - } |
|
41 | + public static function hasRightClosePageWithError($handler) { |
|
42 | + if (hasRight($handler) == false) |
|
43 | + die("You are not allowed here"); //FIXME |
|
44 | + } |
|
45 | 45 | |
46 | 46 | } |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
176 | - * @param string $pluginName |
|
177 | - * @param int $urlId |
|
178 | - */ |
|
176 | + * @param string $pluginName |
|
177 | + * @param int $urlId |
|
178 | + */ |
|
179 | 179 | public function uninstall($pluginName, $urlId = null) |
180 | 180 | { |
181 | 181 | if (empty($urlId)) { |
@@ -252,12 +252,12 @@ discard block |
||
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |
255 | - * @param string $region |
|
256 | - * @param string $template |
|
257 | - * @param bool $forced |
|
258 | - * |
|
259 | - * @return null|string |
|
260 | - */ |
|
255 | + * @param string $region |
|
256 | + * @param string $template |
|
257 | + * @param bool $forced |
|
258 | + * |
|
259 | + * @return null|string |
|
260 | + */ |
|
261 | 261 | public function load_region($region, $template, $forced = false) |
262 | 262 | { |
263 | 263 | if ($region == 'course_tool_plugin') { |
@@ -167,9 +167,9 @@ |
||
167 | 167 | ini_set('session.use_cookies', $old_use_cookies); |
168 | 168 | session_cache_limiter($old_session_cache_limiter); |
169 | 169 | } else { |
170 | - if (isset($_OLD_SESSION)) { |
|
171 | - $_SESSION = $_OLD_SESSION; |
|
172 | - unset($_OLD_SESSION); |
|
170 | + if (isset($_OLD_SESSION)) { |
|
171 | + $_SESSION = $_OLD_SESSION; |
|
172 | + unset($_OLD_SESSION); |
|
173 | 173 | } else { |
174 | 174 | unset($_SESSION); |
175 | 175 | } |
@@ -257,27 +257,27 @@ discard block |
||
257 | 257 | switch ($hash) { |
258 | 258 | case 'md2': |
259 | 259 | $this->b = 16; |
260 | - $this->hash = array($this, '_md2'); |
|
261 | - break; |
|
260 | + $this->hash = array($this, '_md2'); |
|
261 | + break; |
|
262 | 262 | case 'md5': |
263 | 263 | case 'md5-96': |
264 | 264 | $this->b = 64; |
265 | - $this->hash = array($this, '_md5'); |
|
266 | - break; |
|
265 | + $this->hash = array($this, '_md5'); |
|
266 | + break; |
|
267 | 267 | case 'sha256': |
268 | 268 | $this->b = 64; |
269 | - $this->hash = array($this, '_sha256'); |
|
270 | - break; |
|
269 | + $this->hash = array($this, '_sha256'); |
|
270 | + break; |
|
271 | 271 | case 'sha384': |
272 | 272 | case 'sha512': |
273 | 273 | $this->b = 128; |
274 | - $this->hash = array($this, '_sha512'); |
|
275 | - break; |
|
274 | + $this->hash = array($this, '_sha512'); |
|
275 | + break; |
|
276 | 276 | case 'sha1': |
277 | 277 | case 'sha1-96': |
278 | 278 | default: |
279 | 279 | $this->b = 64; |
280 | - $this->hash = array($this, '_sha1'); |
|
280 | + $this->hash = array($this, '_sha1'); |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | $this->ipad = str_repeat(chr(0x36), $this->b); |
@@ -378,24 +378,24 @@ discard block |
||
378 | 378 | function _md2($m) |
379 | 379 | { |
380 | 380 | static $s = array( |
381 | - 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, |
|
382 | - 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, |
|
383 | - 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, |
|
381 | + 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, |
|
382 | + 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, |
|
383 | + 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, |
|
384 | 384 | 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251, |
385 | 385 | 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63, |
386 | 386 | 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50, |
387 | - 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165, |
|
387 | + 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165, |
|
388 | 388 | 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210, |
389 | 389 | 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157, |
390 | 390 | 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27, |
391 | - 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, |
|
392 | - 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, |
|
391 | + 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, |
|
392 | + 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, |
|
393 | 393 | 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65, |
394 | 394 | 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123, |
395 | - 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, |
|
395 | + 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, |
|
396 | 396 | 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228, |
397 | 397 | 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237, |
398 | - 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 |
|
398 | + 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 |
|
399 | 399 | ); |
400 | 400 | |
401 | 401 | // Step 1. Append Padding Bytes |
@@ -494,11 +494,11 @@ discard block |
||
494 | 494 | // Extend the sixteen 32-bit words into sixty-four 32-bit words |
495 | 495 | for ($i = 16; $i < 64; $i++) { |
496 | 496 | $s0 = $this->_rightRotate($w[$i - 15], 7) ^ |
497 | - $this->_rightRotate($w[$i - 15], 18) ^ |
|
498 | - $this->_rightShift( $w[$i - 15], 3); |
|
497 | + $this->_rightRotate($w[$i - 15], 18) ^ |
|
498 | + $this->_rightShift( $w[$i - 15], 3); |
|
499 | 499 | $s1 = $this->_rightRotate($w[$i - 2], 17) ^ |
500 | - $this->_rightRotate($w[$i - 2], 19) ^ |
|
501 | - $this->_rightShift( $w[$i - 2], 10); |
|
500 | + $this->_rightRotate($w[$i - 2], 19) ^ |
|
501 | + $this->_rightShift( $w[$i - 2], 10); |
|
502 | 502 | $w[$i] = $this->_add($w[$i - 16], $s0, $w[$i - 7], $s1); |
503 | 503 | |
504 | 504 | } |
@@ -509,18 +509,18 @@ discard block |
||
509 | 509 | // Main loop |
510 | 510 | for ($i = 0; $i < 64; $i++) { |
511 | 511 | $s0 = $this->_rightRotate($a, 2) ^ |
512 | - $this->_rightRotate($a, 13) ^ |
|
513 | - $this->_rightRotate($a, 22); |
|
512 | + $this->_rightRotate($a, 13) ^ |
|
513 | + $this->_rightRotate($a, 22); |
|
514 | 514 | $maj = ($a & $b) ^ |
515 | - ($a & $c) ^ |
|
516 | - ($b & $c); |
|
515 | + ($a & $c) ^ |
|
516 | + ($b & $c); |
|
517 | 517 | $t2 = $this->_add($s0, $maj); |
518 | 518 | |
519 | 519 | $s1 = $this->_rightRotate($e, 6) ^ |
520 | - $this->_rightRotate($e, 11) ^ |
|
521 | - $this->_rightRotate($e, 25); |
|
520 | + $this->_rightRotate($e, 11) ^ |
|
521 | + $this->_rightRotate($e, 25); |
|
522 | 522 | $ch = ($e & $f) ^ |
523 | - ($this->_not($e) & $g); |
|
523 | + ($this->_not($e) & $g); |
|
524 | 524 | $t1 = $this->_add($h, $s1, $ch, $k[$i], $w[$i]); |
525 | 525 | |
526 | 526 | $h = $g; |
@@ -635,16 +635,16 @@ discard block |
||
635 | 635 | // Extend the sixteen 32-bit words into eighty 32-bit words |
636 | 636 | for ($i = 16; $i < 80; $i++) { |
637 | 637 | $temp = array( |
638 | - $w[$i - 15]->bitwise_rightRotate(1), |
|
639 | - $w[$i - 15]->bitwise_rightRotate(8), |
|
640 | - $w[$i - 15]->bitwise_rightShift(7) |
|
638 | + $w[$i - 15]->bitwise_rightRotate(1), |
|
639 | + $w[$i - 15]->bitwise_rightRotate(8), |
|
640 | + $w[$i - 15]->bitwise_rightShift(7) |
|
641 | 641 | ); |
642 | 642 | $s0 = $temp[0]->bitwise_xor($temp[1]); |
643 | 643 | $s0 = $s0->bitwise_xor($temp[2]); |
644 | 644 | $temp = array( |
645 | - $w[$i - 2]->bitwise_rightRotate(19), |
|
646 | - $w[$i - 2]->bitwise_rightRotate(61), |
|
647 | - $w[$i - 2]->bitwise_rightShift(6) |
|
645 | + $w[$i - 2]->bitwise_rightRotate(19), |
|
646 | + $w[$i - 2]->bitwise_rightRotate(61), |
|
647 | + $w[$i - 2]->bitwise_rightShift(6) |
|
648 | 648 | ); |
649 | 649 | $s1 = $temp[0]->bitwise_xor($temp[1]); |
650 | 650 | $s1 = $s1->bitwise_xor($temp[2]); |
@@ -625,13 +625,13 @@ |
||
625 | 625 | $l^= $p[++$i]; |
626 | 626 | $r^= ($sb_0[$l >> 24 & 0xff] + |
627 | 627 | $sb_1[$l >> 16 & 0xff] ^ |
628 | - $sb_2[$l >> 8 & 0xff]) + |
|
628 | + $sb_2[$l >> 8 & 0xff]) + |
|
629 | 629 | $sb_3[$l & 0xff]; |
630 | 630 | |
631 | 631 | $r^= $p[++$i]; |
632 | 632 | $l^= ($sb_0[$r >> 24 & 0xff] + |
633 | 633 | $sb_1[$r >> 16 & 0xff] ^ |
634 | - $sb_2[$r >> 8 & 0xff]) + |
|
634 | + $sb_2[$r >> 8 & 0xff]) + |
|
635 | 635 | $sb_3[$r & 0xff]; |
636 | 636 | |
637 | 637 | } |