@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | private $user = null; |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | - * List of import errors |
|
| 86 | - */ |
|
| 87 | - protected $errors = array(); |
|
| 85 | + * List of import errors |
|
| 86 | + */ |
|
| 87 | + protected $errors = array(); |
|
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * List of actions, and how many times that action was taken |
@@ -305,26 +305,26 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /** |
| 308 | - * Returns errors that were encountered during importing |
|
| 309 | - * Maximum of one error message per record, but you can append if you need to |
|
| 310 | - * |
|
| 311 | - * @return Array ( |
|
| 312 | - * record_# => error message |
|
| 313 | - * ) |
|
| 314 | - */ |
|
| 315 | - public function get_errors() { |
|
| 308 | + * Returns errors that were encountered during importing |
|
| 309 | + * Maximum of one error message per record, but you can append if you need to |
|
| 310 | + * |
|
| 311 | + * @return Array ( |
|
| 312 | + * record_# => error message |
|
| 313 | + * ) |
|
| 314 | + */ |
|
| 315 | + public function get_errors() { |
|
| 316 | 316 | return $this->errors; |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
| 320 | - * Returns a list of actions taken, and the number of records for that action. |
|
| 321 | - * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin. |
|
| 322 | - * |
|
| 323 | - * @return Array ( |
|
| 324 | - * action => record count |
|
| 325 | - * ) |
|
| 326 | - */ |
|
| 327 | - public function get_results() { |
|
| 320 | + * Returns a list of actions taken, and the number of records for that action. |
|
| 321 | + * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin. |
|
| 322 | + * |
|
| 323 | + * @return Array ( |
|
| 324 | + * action => record count |
|
| 325 | + * ) |
|
| 326 | + */ |
|
| 327 | + public function get_results() { |
|
| 328 | 328 | return $this->results; |
| 329 | 329 | } |
| 330 | 330 | } // end of iface_export_plugin |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | return; // not found, should not happen |
| 673 | 673 | } |
| 674 | 674 | if ($type && (($type == 'd') == !($stat['mode'] & Vfs\Sqlfs\StreamWrapper::MODE_DIR) || // != is_dir() which can be true for symlinks |
| 675 | - $type == 'F' && is_dir($path))) // symlink to a directory |
|
| 675 | + $type == 'F' && is_dir($path))) // symlink to a directory |
|
| 676 | 676 | { |
| 677 | 677 | return; // wrong type |
| 678 | 678 | } |
@@ -1621,13 +1621,13 @@ discard block |
||
| 1621 | 1621 | { |
| 1622 | 1622 | return false; |
| 1623 | 1623 | } |
| 1624 | - // remove the lock info evtl. set in the cache |
|
| 1625 | - unset(self::$lock_cache[$path]); |
|
| 1624 | + // remove the lock info evtl. set in the cache |
|
| 1625 | + unset(self::$lock_cache[$path]); |
|
| 1626 | 1626 | |
| 1627 | - if ($timeout < 1000000) // < 1000000 is a relative timestamp, so we add the current time |
|
| 1628 | - { |
|
| 1629 | - $timeout += time(); |
|
| 1630 | - } |
|
| 1627 | + if ($timeout < 1000000) // < 1000000 is a relative timestamp, so we add the current time |
|
| 1628 | + { |
|
| 1629 | + $timeout += time(); |
|
| 1630 | + } |
|
| 1631 | 1631 | |
| 1632 | 1632 | if ($update) // Lock Update |
| 1633 | 1633 | { |
@@ -1688,32 +1688,32 @@ discard block |
||
| 1688 | 1688 | return $ret; |
| 1689 | 1689 | } |
| 1690 | 1690 | |
| 1691 | - /** |
|
| 1692 | - * unlock a ressource/path |
|
| 1693 | - * |
|
| 1694 | - * @param string $path path to unlock |
|
| 1695 | - * @param string $token locktoken |
|
| 1691 | + /** |
|
| 1692 | + * unlock a ressource/path |
|
| 1693 | + * |
|
| 1694 | + * @param string $path path to unlock |
|
| 1695 | + * @param string $token locktoken |
|
| 1696 | 1696 | * @param boolean $check_writable =true should we check if the ressource is writable, before granting locks, default yes |
| 1697 | - * @return boolean true on success |
|
| 1698 | - */ |
|
| 1699 | - static function unlock($path,$token,$check_writable=true) |
|
| 1700 | - { |
|
| 1697 | + * @return boolean true on success |
|
| 1698 | + */ |
|
| 1699 | + static function unlock($path,$token,$check_writable=true) |
|
| 1700 | + { |
|
| 1701 | 1701 | // we require write rights to lock/unlock a resource |
| 1702 | 1702 | if ($check_writable && !self::is_writable($path)) |
| 1703 | 1703 | { |
| 1704 | 1704 | return false; |
| 1705 | 1705 | } |
| 1706 | - if (($ret = self::$db->delete(self::LOCK_TABLE,array( |
|
| 1707 | - 'lock_path' => $path, |
|
| 1708 | - 'lock_token' => $token, |
|
| 1709 | - ),__LINE__,__FILE__) && self::$db->affected_rows())) |
|
| 1710 | - { |
|
| 1711 | - // remove the lock from the cache too |
|
| 1712 | - unset(self::$lock_cache[$path]); |
|
| 1713 | - } |
|
| 1706 | + if (($ret = self::$db->delete(self::LOCK_TABLE,array( |
|
| 1707 | + 'lock_path' => $path, |
|
| 1708 | + 'lock_token' => $token, |
|
| 1709 | + ),__LINE__,__FILE__) && self::$db->affected_rows())) |
|
| 1710 | + { |
|
| 1711 | + // remove the lock from the cache too |
|
| 1712 | + unset(self::$lock_cache[$path]); |
|
| 1713 | + } |
|
| 1714 | 1714 | if (self::LOCK_DEBUG) error_log(__METHOD__."($path,$token,$check_writable) returns ".($ret ? 'true' : 'false')); |
| 1715 | 1715 | return $ret; |
| 1716 | - } |
|
| 1716 | + } |
|
| 1717 | 1717 | |
| 1718 | 1718 | /** |
| 1719 | 1719 | * checkLock() helper |
@@ -1741,13 +1741,13 @@ discard block |
||
| 1741 | 1741 | } |
| 1742 | 1742 | if ($result && $result['expires'] < time()) // lock is expired --> remove it |
| 1743 | 1743 | { |
| 1744 | - self::$db->delete(self::LOCK_TABLE,array( |
|
| 1745 | - 'lock_path' => $result['path'], |
|
| 1746 | - 'lock_token' => $result['token'], |
|
| 1747 | - ),__LINE__,__FILE__); |
|
| 1744 | + self::$db->delete(self::LOCK_TABLE,array( |
|
| 1745 | + 'lock_path' => $result['path'], |
|
| 1746 | + 'lock_token' => $result['token'], |
|
| 1747 | + ),__LINE__,__FILE__); |
|
| 1748 | 1748 | |
| 1749 | 1749 | if (self::LOCK_DEBUG) error_log(__METHOD__."($path) lock is expired at ".date('Y-m-d H:i:s',$result['expires'])." --> removed"); |
| 1750 | - $result = false; |
|
| 1750 | + $result = false; |
|
| 1751 | 1751 | } |
| 1752 | 1752 | if (self::LOCK_DEBUG) error_log(__METHOD__."($path) returns ".($result?array2string($result):'false')); |
| 1753 | 1753 | return self::$lock_cache[$path] = $result; |
@@ -1887,9 +1887,9 @@ discard block |
||
| 1887 | 1887 | $image = Image::find($mime_sub, 'navbar'); |
| 1888 | 1888 | } |
| 1889 | 1889 | else if ($file && $mime_main == 'image' && in_array($mime_sub, array('png','jpeg','jpg','gif','bmp')) && |
| 1890 | - (string)$GLOBALS['egw_info']['server']['link_list_thumbnail'] != '0' && |
|
| 1891 | - (string)$GLOBALS['egw_info']['user']['preferences']['common']['link_list_thumbnail'] != '0' && |
|
| 1892 | - ($stat = self::stat($file)) && $stat['size'] < 1500000) |
|
| 1890 | + (string)$GLOBALS['egw_info']['server']['link_list_thumbnail'] != '0' && |
|
| 1891 | + (string)$GLOBALS['egw_info']['user']['preferences']['common']['link_list_thumbnail'] != '0' && |
|
| 1892 | + ($stat = self::stat($file)) && $stat['size'] < 1500000) |
|
| 1893 | 1893 | { |
| 1894 | 1894 | if (substr($file, 0, 6) == '/apps/') |
| 1895 | 1895 | { |
@@ -447,10 +447,10 @@ discard block |
||
| 447 | 447 | * Important: PHP 5.0 introduced a bug that wasn't fixed until 5.1: the return value has to be the oposite! |
| 448 | 448 | * |
| 449 | 449 | * if(version_compare(PHP_VERSION,'5.0','>=') && version_compare(PHP_VERSION,'5.1','<')) |
| 450 | - * { |
|
| 450 | + * { |
|
| 451 | 451 | * $eof = !$eof; |
| 452 | 452 | * } |
| 453 | - * |
|
| 453 | + * |
|
| 454 | 454 | * @return boolean true if the read/write position is at the end of the stream and no more data availible, false otherwise |
| 455 | 455 | */ |
| 456 | 456 | function stream_eof ( ) |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | * See fseek() for more information about these parameters. |
| 486 | 486 | * |
| 487 | 487 | * @param integer $offset |
| 488 | - * @param integer $whence SEEK_SET - 0 - Set position equal to offset bytes |
|
| 488 | + * @param integer $whence SEEK_SET - 0 - Set position equal to offset bytes |
|
| 489 | 489 | * SEEK_CUR - 1 - Set position to current location plus offset. |
| 490 | 490 | * SEEK_END - 2 - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.) |
| 491 | 491 | * @return boolean TRUE if the position was updated, FALSE otherwise. |
@@ -681,8 +681,8 @@ discard block |
||
| 681 | 681 | $maxdepth=10; |
| 682 | 682 | $depth2propagate = (int)$depth + 1; |
| 683 | 683 | if ($depth2propagate > $maxdepth) return is_dir($pathname); |
| 684 | - is_dir(Vfs::dirname($pathname)) || self::mkdir_recursive(Vfs::dirname($pathname), $mode, $depth2propagate); |
|
| 685 | - return is_dir($pathname) || @mkdir($pathname, $mode); |
|
| 684 | + is_dir(Vfs::dirname($pathname)) || self::mkdir_recursive(Vfs::dirname($pathname), $mode, $depth2propagate); |
|
| 685 | + return is_dir($pathname) || @mkdir($pathname, $mode); |
|
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | /** |
@@ -411,10 +411,10 @@ discard block |
||
| 411 | 411 | * Important: PHP 5.0 introduced a bug that wasn't fixed until 5.1: the return value has to be the oposite! |
| 412 | 412 | * |
| 413 | 413 | * if(version_compare(PHP_VERSION,'5.0','>=') && version_compare(PHP_VERSION,'5.1','<')) |
| 414 | - * { |
|
| 414 | + * { |
|
| 415 | 415 | * $eof = !$eof; |
| 416 | 416 | * } |
| 417 | - * |
|
| 417 | + * |
|
| 418 | 418 | * @return boolean true if the read/write position is at the end of the stream and no more data availible, false otherwise |
| 419 | 419 | */ |
| 420 | 420 | function stream_eof ( ) |
@@ -1053,7 +1053,7 @@ discard block |
||
| 1053 | 1053 | if (self::LOG_LEVEL > 1) error_log(__METHOD__."('$path',$flags,'$url'): ".function_backtrace(1)); |
| 1054 | 1054 | |
| 1055 | 1055 | while (($rel_path = Vfs::basename($url).($rel_path ? '/'.$rel_path : '')) && |
| 1056 | - ($url = Vfs::dirname($url))) |
|
| 1056 | + ($url = Vfs::dirname($url))) |
|
| 1057 | 1057 | { |
| 1058 | 1058 | if (($stat = self::url_stat($url,0,false,false))) |
| 1059 | 1059 | { |
@@ -80,10 +80,10 @@ |
||
| 80 | 80 | * Important: PHP 5.0 introduced a bug that wasn't fixed until 5.1: the return value has to be the oposite! |
| 81 | 81 | * |
| 82 | 82 | * if(version_compare(PHP_VERSION,'5.0','>=') && version_compare(PHP_VERSION,'5.1','<')) |
| 83 | - * { |
|
| 83 | + * { |
|
| 84 | 84 | * $eof = !$eof; |
| 85 | 85 | * } |
| 86 | - * |
|
| 86 | + * |
|
| 87 | 87 | * @return boolean true if the read/write position is at the end of the stream and no more data availible, false otherwise |
| 88 | 88 | */ |
| 89 | 89 | function stream_eof ( ); |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | - * Set the domain used for cookies |
|
| 155 | - * |
|
| 156 | - * @return string domain |
|
| 157 | - */ |
|
| 154 | + * Set the domain used for cookies |
|
| 155 | + * |
|
| 156 | + * @return string domain |
|
| 157 | + */ |
|
| 158 | 158 | static function cookiedomain() |
| 159 | 159 | { |
| 160 | 160 | // Use HTTP_X_FORWARDED_HOST if set, which is the case behind a none-transparent proxy |
@@ -175,12 +175,12 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
| 178 | - * Set a cookie |
|
| 179 | - * |
|
| 180 | - * @param string $cookiename name of cookie to be set |
|
| 181 | - * @param string $cookievalue value to be used, if unset cookie is cleared (optional) |
|
| 182 | - * @param int $cookietime when cookie should expire, 0 for session only (optional) |
|
| 183 | - */ |
|
| 178 | + * Set a cookie |
|
| 179 | + * |
|
| 180 | + * @param string $cookiename name of cookie to be set |
|
| 181 | + * @param string $cookievalue value to be used, if unset cookie is cleared (optional) |
|
| 182 | + * @param int $cookietime when cookie should expire, 0 for session only (optional) |
|
| 183 | + */ |
|
| 184 | 184 | function set_cookie($cookiename,$cookievalue='',$cookietime=0) |
| 185 | 185 | { |
| 186 | 186 | if(!isset($this->cookie_domain)) |
@@ -344,19 +344,19 @@ discard block |
||
| 344 | 344 | return true; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - /** |
|
| 348 | - * check if username and password is valid |
|
| 349 | - * |
|
| 350 | - * this function compares the supplied and stored username and password |
|
| 351 | - * as any of the passwords can be clear text or md5 we convert them to md5 |
|
| 352 | - * internal and compare always the md5 hashs |
|
| 353 | - * |
|
| 354 | - * @param string $user the user supplied username |
|
| 355 | - * @param string $pw the user supplied password |
|
| 356 | - * @param string $conf_user the configured username |
|
| 357 | - * @param string $hash hash to check password agains (no {prefix} for plain and md5!) |
|
| 358 | - * @returns bool true on success |
|
| 359 | - */ |
|
| 347 | + /** |
|
| 348 | + * check if username and password is valid |
|
| 349 | + * |
|
| 350 | + * this function compares the supplied and stored username and password |
|
| 351 | + * as any of the passwords can be clear text or md5 we convert them to md5 |
|
| 352 | + * internal and compare always the md5 hashs |
|
| 353 | + * |
|
| 354 | + * @param string $user the user supplied username |
|
| 355 | + * @param string $pw the user supplied password |
|
| 356 | + * @param string $conf_user the configured username |
|
| 357 | + * @param string $hash hash to check password agains (no {prefix} for plain and md5!) |
|
| 358 | + * @returns bool true on success |
|
| 359 | + */ |
|
| 360 | 360 | static function check_auth($user, $pw, $conf_user, $hash) |
| 361 | 361 | { |
| 362 | 362 | if ($user !== $conf_user) |
@@ -728,10 +728,10 @@ discard block |
||
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | /** |
| 731 | - * call the hooks for a single application |
|
| 732 | - * |
|
| 733 | - * @param $location hook location - required |
|
| 734 | - * @param $appname application name - optional |
|
| 731 | + * call the hooks for a single application |
|
| 732 | + * |
|
| 733 | + * @param $location hook location - required |
|
| 734 | + * @param $appname application name - optional |
|
| 735 | 735 | */ |
| 736 | 736 | static function hook($location, $appname='') |
| 737 | 737 | { |
@@ -222,7 +222,7 @@ |
||
| 222 | 222 | . '<br />'.lang('to allow password authentification add the following line to your pg_hba.conf (above all others) AND restart postgres:') |
| 223 | 223 | . '<br /><i># TYPE DATABASE USER CIDR-ADDRESS METHOD</i>' |
| 224 | 224 | .($info['db_host'] ? "<br /><i><b>host $info[db_name] $info[db_user] $ip/32 password</b></i>" : |
| 225 | - "<br /><i><b>local $info[db_name] $info[db_user] password</b></i>")); |
|
| 225 | + "<br /><i><b>local $info[db_name] $info[db_user] password</b></i>")); |
|
| 226 | 226 | //$setup_tpl->parse('V_db_stage_1','B_db_stage_1'); |
| 227 | 227 | //break; |
| 228 | 228 | default: |
@@ -350,7 +350,7 @@ |
||
| 350 | 350 | { |
| 351 | 351 | echo lang('because it depends upon') . ':<br />' . "\n"; |
| 352 | 352 | list($depapp,$depver) = parsedep($setup_info[$resolve]['depends'],False); |
| 353 | - $depapp_count = count($depapp); |
|
| 353 | + $depapp_count = count($depapp); |
|
| 354 | 354 | for ($i=0; $i<$depapp_count; $i++) |
| 355 | 355 | { |
| 356 | 356 | echo '<br />' . $depapp[$i] . ': '; |
@@ -88,33 +88,33 @@ |
||
| 88 | 88 | public function get_selectors_etpl(); |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | - * Returns errors that were encountered during importing |
|
| 92 | - * Maximum of one error message per record, but you can concatenate them if you need to |
|
| 93 | - * |
|
| 94 | - * @return Array ( |
|
| 95 | - * record_# => error message |
|
| 96 | - * ) |
|
| 97 | - */ |
|
| 91 | + * Returns errors that were encountered during importing |
|
| 92 | + * Maximum of one error message per record, but you can concatenate them if you need to |
|
| 93 | + * |
|
| 94 | + * @return Array ( |
|
| 95 | + * record_# => error message |
|
| 96 | + * ) |
|
| 97 | + */ |
|
| 98 | 98 | public function get_errors(); |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * Returns warnings that were encountered during importing |
|
| 102 | - * Maximum of one warning message per record, but you can concatenate them if you need to |
|
| 103 | - * |
|
| 104 | - * @return Array ( |
|
| 105 | - * record_# => warning message |
|
| 106 | - * ) |
|
| 107 | - */ |
|
| 101 | + * Returns warnings that were encountered during importing |
|
| 102 | + * Maximum of one warning message per record, but you can concatenate them if you need to |
|
| 103 | + * |
|
| 104 | + * @return Array ( |
|
| 105 | + * record_# => warning message |
|
| 106 | + * ) |
|
| 107 | + */ |
|
| 108 | 108 | public function get_warnings(); |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * Returns a list of actions taken, and the number of records for that action. |
|
| 112 | - * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin. |
|
| 113 | - * |
|
| 114 | - * @return Array ( |
|
| 115 | - * action => record count |
|
| 116 | - * ) |
|
| 117 | - */ |
|
| 111 | + * Returns a list of actions taken, and the number of records for that action. |
|
| 112 | + * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin. |
|
| 113 | + * |
|
| 114 | + * @return Array ( |
|
| 115 | + * action => record count |
|
| 116 | + * ) |
|
| 117 | + */ |
|
| 118 | 118 | public function get_results(); |
| 119 | 119 | |
| 120 | 120 | } // end of iface_export_plugin |