@@ -168,7 +168,11 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | - if (!isset($setup_info[$app]) || !is_array($setup_info[$app])) return null; // app got eg. removed in filesystem |
|
| 171 | + if (!isset($setup_info[$app]) || !is_array($setup_info[$app])) |
|
| 172 | + { |
|
| 173 | + return null; |
|
| 174 | + } |
|
| 175 | + // app got eg. removed in filesystem |
|
| 172 | 176 | |
| 173 | 177 | $app_info = array_merge($GLOBALS['egw_info']['apps'][$app], $setup_info[$app]); |
| 174 | 178 | |
@@ -191,7 +195,10 @@ discard block |
||
| 191 | 195 | { |
| 192 | 196 | $ret['author'] = $this->_getHtmlPersonalInfo($setup_info[$app], 'author'); |
| 193 | 197 | $ret['maintainer'] = $this->_getHtmlPersonalInfo($setup_info[$app], 'maintainer'); |
| 194 | - if ($app_info['version'] != $setup_info[$app]['version']) $ret['version'] .= ' ('.$setup_info[$app]['version'].')'; |
|
| 198 | + if ($app_info['version'] != $setup_info[$app]['version']) |
|
| 199 | + { |
|
| 200 | + $ret['version'] .= ' ('.$setup_info[$app]['version'].')'; |
|
| 201 | + } |
|
| 195 | 202 | $ret['license'] = $setup_info[$app]['license']; |
| 196 | 203 | $ret['description'] = $setup_info[$app]['description']; |
| 197 | 204 | $ret['note'] = $setup_info[$app]['note']; |
@@ -216,39 +223,54 @@ discard block |
||
| 216 | 223 | { |
| 217 | 224 | $authors = array(); |
| 218 | 225 | // get the author(s) |
| 219 | - if ($setup_info[$f]) { |
|
| 226 | + if ($setup_info[$f]) |
|
| 227 | + { |
|
| 220 | 228 | // author is set |
| 221 | - if (!is_array($setup_info[$f])) { |
|
| 229 | + if (!is_array($setup_info[$f])) |
|
| 230 | + { |
|
| 222 | 231 | // author is no array |
| 223 | 232 | $authors[0]['name'] = $setup_info[$f]; |
| 224 | - if ($setup_info[$f.'_email']) { |
|
| 233 | + if ($setup_info[$f.'_email']) |
|
| 234 | + { |
|
| 225 | 235 | $authors[0]['email'] = $setup_info[$f.'_email']; |
| 226 | 236 | } |
| 227 | - if ($setup_info[$f.'_url']) { |
|
| 237 | + if ($setup_info[$f.'_url']) |
|
| 238 | + { |
|
| 228 | 239 | $authors[0]['url'] = $setup_info[$f.'_url']; |
| 229 | 240 | } |
| 230 | 241 | |
| 231 | - } else { |
|
| 242 | + } |
|
| 243 | + else |
|
| 244 | + { |
|
| 232 | 245 | // author is array |
| 233 | - if ($setup_info[$f]['name']) { |
|
| 246 | + if ($setup_info[$f]['name']) |
|
| 247 | + { |
|
| 234 | 248 | // only one author |
| 235 | 249 | $authors[0]['name'] = $setup_info[$f]['name']; |
| 236 | - if ($setup_info[$f]['email']) { |
|
| 250 | + if ($setup_info[$f]['email']) |
|
| 251 | + { |
|
| 237 | 252 | $authors[0]['email'] = $setup_info[$f]['email']; |
| 238 | 253 | } |
| 239 | - if ($setup_info[$f]['url']) { |
|
| 254 | + if ($setup_info[$f]['url']) |
|
| 255 | + { |
|
| 240 | 256 | $authors[0]['url'] = $setup_info[$f]['url']; |
| 241 | 257 | } |
| 242 | - } else { |
|
| 258 | + } |
|
| 259 | + else |
|
| 260 | + { |
|
| 243 | 261 | // may be more authors |
| 244 | - foreach (array_keys($setup_info[$f]) as $number) { |
|
| 245 | - if ($setup_info[$f][$number]['name']) { |
|
| 262 | + foreach (array_keys($setup_info[$f]) as $number) |
|
| 263 | + { |
|
| 264 | + if ($setup_info[$f][$number]['name']) |
|
| 265 | + { |
|
| 246 | 266 | $authors[$number]['name'] = $setup_info[$f][$number]['name']; |
| 247 | 267 | } |
| 248 | - if ($setup_info[$f][$number]['email']) { |
|
| 268 | + if ($setup_info[$f][$number]['email']) |
|
| 269 | + { |
|
| 249 | 270 | $authors[$number]['email'] = $setup_info[$f][$number]['email']; |
| 250 | 271 | } |
| 251 | - if ($setup_info[$f][$number]['url']) { |
|
| 272 | + if ($setup_info[$f][$number]['url']) |
|
| 273 | + { |
|
| 252 | 274 | $authors[$number]['url'] = $setup_info[$f][$number]['url']; |
| 253 | 275 | } |
| 254 | 276 | } |
@@ -258,15 +280,19 @@ discard block |
||
| 258 | 280 | |
| 259 | 281 | // html format authors |
| 260 | 282 | $s = ''; |
| 261 | - foreach ($authors as $author) { |
|
| 262 | - if ($s != '') { |
|
| 283 | + foreach ($authors as $author) |
|
| 284 | + { |
|
| 285 | + if ($s != '') |
|
| 286 | + { |
|
| 263 | 287 | $s .= '<br />'; |
| 264 | 288 | } |
| 265 | 289 | $s .= lang('name').': '.$author['name']; |
| 266 | - if ($author['email']) { |
|
| 290 | + if ($author['email']) |
|
| 291 | + { |
|
| 267 | 292 | $s .= '<br />'.lang('email').': <a href="mailto:'.$author['email'].'">'.$author['email'].'</a>'; |
| 268 | 293 | } |
| 269 | - if ($author['url']) { |
|
| 294 | + if ($author['url']) |
|
| 295 | + { |
|
| 270 | 296 | $s .= '<br />'.lang('url').': <a href="'.$author['url'].'" target="_blank">'.$author['url'].'</a>'; |
| 271 | 297 | } |
| 272 | 298 | } |
@@ -300,8 +326,14 @@ discard block |
||
| 300 | 326 | |
| 301 | 327 | if (isset(self::$knownLicenses[strtoupper($name)])) |
| 302 | 328 | { |
| 303 | - if (empty($url)) $url = self::$knownLicenses[$name=strtoupper($name)][0]; |
|
| 304 | - if (empty($title)) $title = self::$knownLicenses[$name=strtoupper($name)][1]; |
|
| 329 | + if (empty($url)) |
|
| 330 | + { |
|
| 331 | + $url = self::$knownLicenses[$name=strtoupper($name)][0]; |
|
| 332 | + } |
|
| 333 | + if (empty($title)) |
|
| 334 | + { |
|
| 335 | + $title = self::$knownLicenses[$name=strtoupper($name)][1]; |
|
| 336 | + } |
|
| 305 | 337 | } |
| 306 | 338 | |
| 307 | 339 | return array( |
@@ -164,9 +164,12 @@ |
||
| 164 | 164 | { |
| 165 | 165 | // adding links of refreshed entry, to give others apps more information about necessity to refresh |
| 166 | 166 | if (isset(self::$extra['refresh-opener']) && count(self::$extra['refresh-opener']) <= 8 && // do not run twice |
| 167 | - !empty(self::$extra['refresh-opener'][1]) && !empty(self::$extra['refresh-opener'][2])) // app/id given |
|
| 167 | + !empty(self::$extra['refresh-opener'][1]) && !empty(self::$extra['refresh-opener'][2])) |
|
| 168 | + { |
|
| 169 | + // app/id given |
|
| 168 | 170 | { |
| 169 | 171 | $links = Link::get_links(self::$extra['refresh-opener'][1], self::$extra['refresh-opener'][2]); |
| 172 | + } |
|
| 170 | 173 | $apps = array(); |
| 171 | 174 | foreach($links as $link) |
| 172 | 175 | { |
@@ -47,7 +47,10 @@ discard block |
||
| 47 | 47 | function header(array $extra=array()) |
| 48 | 48 | { |
| 49 | 49 | // make sure header is output only once |
| 50 | - if (self::$header_done) return ''; |
|
| 50 | + if (self::$header_done) |
|
| 51 | + { |
|
| 52 | + return ''; |
|
| 53 | + } |
|
| 51 | 54 | self::$header_done = true; |
| 52 | 55 | |
| 53 | 56 | // js stuff is not needed by login page or in popups |
@@ -135,7 +138,11 @@ discard block |
||
| 135 | 138 | function footer() |
| 136 | 139 | { |
| 137 | 140 | static $footer_done=0; |
| 138 | - if ($footer_done++) return; // prevent multiple footers, not sure we still need this (RalfBecker) |
|
| 141 | + if ($footer_done++) |
|
| 142 | + { |
|
| 143 | + return; |
|
| 144 | + } |
|
| 145 | + // prevent multiple footers, not sure we still need this (RalfBecker) |
|
| 139 | 146 | |
| 140 | 147 | return "</body>\n</html>\n"; // close body and html tag, eg. for popups |
| 141 | 148 | } |
@@ -218,7 +218,8 @@ |
||
| 218 | 218 | { |
| 219 | 219 | if(($info = ldap_get_entries($ds, $sr))) |
| 220 | 220 | { |
| 221 | - if($info[0]['objectclasses']) { |
|
| 221 | + if($info[0]['objectclasses']) |
|
| 222 | + { |
|
| 222 | 223 | for($i=0; $i<$info[0]['objectclasses']['count']; $i++) |
| 223 | 224 | { |
| 224 | 225 | $matches = null; |
@@ -20,4 +20,6 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * As you get this only by an error in the code or during development, the message does not need to be translated |
| 22 | 22 | */ |
| 23 | -class InvalidName extends Exception\NoPermission { } |
|
| 23 | +class InvalidName extends Exception\NoPermission |
|
| 24 | +{ |
|
| 25 | +} |
|
@@ -268,7 +268,10 @@ |
||
| 268 | 268 | */ |
| 269 | 269 | public static function fix_content($var, $prefix='') |
| 270 | 270 | { |
| 271 | - if (json_encode($var) !== false) return $var; |
|
| 271 | + if (json_encode($var) !== false) |
|
| 272 | + { |
|
| 273 | + return $var; |
|
| 274 | + } |
|
| 272 | 275 | |
| 273 | 276 | if (is_scalar($var)) |
| 274 | 277 | { |
@@ -20,4 +20,6 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * As you get this only by an error in the code or during development, the message does not need to be translated |
| 22 | 22 | */ |
| 23 | -class Exception extends Api\Exception\WrongParameter { } |
|
| 23 | +class Exception extends Api\Exception\WrongParameter |
|
| 24 | +{ |
|
| 25 | +} |
|
@@ -97,7 +97,10 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function __construct(Handler $handler, $path, array $filter,array &$files=array()) |
| 99 | 99 | { |
| 100 | - if ($this->debug) error_log(__METHOD__."('$path', ".array2string($filter).",)"); |
|
| 100 | + if ($this->debug) |
|
| 101 | + { |
|
| 102 | + error_log(__METHOD__."('$path', ".array2string($filter).",)"); |
|
| 103 | + } |
|
| 101 | 104 | $this->path = $path; |
| 102 | 105 | $this->handler = $handler; |
| 103 | 106 | $this->filter = $filter; |
@@ -112,7 +115,10 @@ discard block |
||
| 112 | 115 | */ |
| 113 | 116 | public function current() |
| 114 | 117 | { |
| 115 | - if ($this->debug) error_log(__METHOD__."() returning ".array2string(current($this->files))); |
|
| 118 | + if ($this->debug) |
|
| 119 | + { |
|
| 120 | + error_log(__METHOD__."() returning ".array2string(current($this->files))); |
|
| 121 | + } |
|
| 116 | 122 | return current($this->files); |
| 117 | 123 | } |
| 118 | 124 | |
@@ -125,7 +131,10 @@ discard block |
||
| 125 | 131 | { |
| 126 | 132 | $current = current($this->files); |
| 127 | 133 | |
| 128 | - if ($this->debug) error_log(__METHOD__."() returning ".array2string($current['path'])); |
|
| 134 | + if ($this->debug) |
|
| 135 | + { |
|
| 136 | + error_log(__METHOD__."() returning ".array2string($current['path'])); |
|
| 137 | + } |
|
| 129 | 138 | return $current['path']; // we return path as key |
| 130 | 139 | } |
| 131 | 140 | |
@@ -136,26 +145,38 @@ discard block |
||
| 136 | 145 | { |
| 137 | 146 | if (next($this->files) !== false) |
| 138 | 147 | { |
| 139 | - if ($this->debug) error_log(__METHOD__."() returning TRUE"); |
|
| 148 | + if ($this->debug) |
|
| 149 | + { |
|
| 150 | + error_log(__METHOD__."() returning TRUE"); |
|
| 151 | + } |
|
| 140 | 152 | return true; |
| 141 | 153 | } |
| 142 | 154 | // check if previous query gave less then CHUNK_SIZE entries --> we're done |
| 143 | 155 | if ($this->start && count($this->files) < self::CHUNK_SIZE) |
| 144 | 156 | { |
| 145 | - if ($this->debug) error_log(__METHOD__."() returning FALSE (no more entries)"); |
|
| 157 | + if ($this->debug) |
|
| 158 | + { |
|
| 159 | + error_log(__METHOD__."() returning FALSE (no more entries)"); |
|
| 160 | + } |
|
| 146 | 161 | return false; |
| 147 | 162 | } |
| 148 | 163 | // try query further files via propfind callback of handler and store result in $this->files |
| 149 | 164 | $this->files = $this->handler->propfind_callback($this->path,$this->filter,array($this->start,self::CHUNK_SIZE)); |
| 150 | 165 | if (!is_array($this->files) || !($entries = count($this->files))) |
| 151 | 166 | { |
| 152 | - if ($this->debug) error_log(__METHOD__."() returning FALSE (no more entries)"); |
|
| 167 | + if ($this->debug) |
|
| 168 | + { |
|
| 169 | + error_log(__METHOD__."() returning FALSE (no more entries)"); |
|
| 170 | + } |
|
| 153 | 171 | return false; // no further entries |
| 154 | 172 | } |
| 155 | 173 | $this->start += self::CHUNK_SIZE; |
| 156 | 174 | reset($this->files); |
| 157 | 175 | |
| 158 | - if ($this->debug) error_log(__METHOD__."() this->start=$this->start, entries=$entries, count(this->files)=".count($this->files)." returning ".array2string(current($this->files) !== false)); |
|
| 176 | + if ($this->debug) |
|
| 177 | + { |
|
| 178 | + error_log(__METHOD__."() this->start=$this->start, entries=$entries, count(this->files)=".count($this->files)." returning ".array2string(current($this->files) !== false)); |
|
| 179 | + } |
|
| 159 | 180 | |
| 160 | 181 | return current($this->files) !== false; |
| 161 | 182 | } |
@@ -165,11 +186,18 @@ discard block |
||
| 165 | 186 | */ |
| 166 | 187 | public function rewind() |
| 167 | 188 | { |
| 168 | - if ($this->debug) error_log(__METHOD__."()"); |
|
| 189 | + if ($this->debug) |
|
| 190 | + { |
|
| 191 | + error_log(__METHOD__."()"); |
|
| 192 | + } |
|
| 169 | 193 | |
| 170 | 194 | $this->start = 0; |
| 171 | 195 | $this->files = $this->common_files; |
| 172 | - if (!$this->files) $this->next(); // otherwise valid will return false and nothing get returned |
|
| 196 | + if (!$this->files) |
|
| 197 | + { |
|
| 198 | + $this->next(); |
|
| 199 | + } |
|
| 200 | + // otherwise valid will return false and nothing get returned |
|
| 173 | 201 | reset($this->files); |
| 174 | 202 | } |
| 175 | 203 | |
@@ -180,7 +208,10 @@ discard block |
||
| 180 | 208 | */ |
| 181 | 209 | public function valid () |
| 182 | 210 | { |
| 183 | - if ($this->debug) error_log(__METHOD__."() returning ".array2string(current($this->files) !== false)); |
|
| 211 | + if ($this->debug) |
|
| 212 | + { |
|
| 213 | + error_log(__METHOD__."() returning ".array2string(current($this->files) !== false)); |
|
| 214 | + } |
|
| 184 | 215 | return current($this->files) !== false; |
| 185 | 216 | } |
| 186 | 217 | } |
@@ -123,7 +123,10 @@ discard block |
||
| 123 | 123 | function __construct($app, Api\CalDAV $caldav) |
| 124 | 124 | { |
| 125 | 125 | $this->app = $app; |
| 126 | - if (!is_null($caldav->debug)) $this->debug = $caldav->debug; |
|
| 126 | + if (!is_null($caldav->debug)) |
|
| 127 | + { |
|
| 128 | + $this->debug = $caldav->debug; |
|
| 129 | + } |
|
| 127 | 130 | $this->base_uri = $caldav->base_uri; |
| 128 | 131 | $this->caldav = $caldav; |
| 129 | 132 | |
@@ -282,11 +285,17 @@ discard block |
||
| 282 | 285 | */ |
| 283 | 286 | function _common_get_put_delete($method,&$options,&$id,&$return_no_access=false,$ignore_if_match=false) |
| 284 | 287 | { |
| 285 | - if (self::$path_extension) $id = basename($id,self::$path_extension); |
|
| 288 | + if (self::$path_extension) |
|
| 289 | + { |
|
| 290 | + $id = basename($id,self::$path_extension); |
|
| 291 | + } |
|
| 286 | 292 | |
| 287 | 293 | if ($this->app != 'principals' && !$GLOBALS['egw_info']['user']['apps'][$this->app]) |
| 288 | 294 | { |
| 289 | - if ($this->debug) error_log(__METHOD__."($method,,$id) 403 Forbidden: no app rights for '$this->app'"); |
|
| 295 | + if ($this->debug) |
|
| 296 | + { |
|
| 297 | + error_log(__METHOD__."($method,,$id) 403 Forbidden: no app rights for '$this->app'"); |
|
| 298 | + } |
|
| 290 | 299 | return '403 Forbidden'; // no app rights |
| 291 | 300 | } |
| 292 | 301 | $extra_acl = $this->method2acl[$method]; |
@@ -295,12 +304,18 @@ discard block |
||
| 295 | 304 | { |
| 296 | 305 | if ($return_no_access && !is_null($entry)) |
| 297 | 306 | { |
| 298 | - if ($this->debug) error_log(__METHOD__."($method,,$id,$return_no_access) \$entry=".array2string($entry).", \$return_no_access set to false"); |
|
| 307 | + if ($this->debug) |
|
| 308 | + { |
|
| 309 | + error_log(__METHOD__."($method,,$id,$return_no_access) \$entry=".array2string($entry).", \$return_no_access set to false"); |
|
| 310 | + } |
|
| 299 | 311 | $return_no_access = false; |
| 300 | 312 | } |
| 301 | 313 | else |
| 302 | 314 | { |
| 303 | - if ($this->debug) error_log(__METHOD__."($method,,$id) 403 Forbidden/404 Not Found: read($id)==".($entry===false?'false':'null')); |
|
| 315 | + if ($this->debug) |
|
| 316 | + { |
|
| 317 | + error_log(__METHOD__."($method,,$id) 403 Forbidden/404 Not Found: read($id)==".($entry===false?'false':'null')); |
|
| 318 | + } |
|
| 304 | 319 | return !is_null($entry) ? '403 Forbidden' : '404 Not Found'; |
| 305 | 320 | } |
| 306 | 321 | } |
@@ -313,11 +328,17 @@ discard block |
||
| 313 | 328 | { |
| 314 | 329 | $this->http_if_match = $_SERVER['HTTP_IF_MATCH']; |
| 315 | 330 | // strip of quotes around etag, if they exist, that way we allow etag with and without quotes |
| 316 | - if ($this->http_if_match[0] == '"') $this->http_if_match = substr($this->http_if_match, 1, -1); |
|
| 331 | + if ($this->http_if_match[0] == '"') |
|
| 332 | + { |
|
| 333 | + $this->http_if_match = substr($this->http_if_match, 1, -1); |
|
| 334 | + } |
|
| 317 | 335 | |
| 318 | 336 | if ($this->http_if_match !== $etag) |
| 319 | 337 | { |
| 320 | - if ($this->debug) error_log(__METHOD__."($method,path=$options[path],$id) HTTP_IF_MATCH='$_SERVER[HTTP_IF_MATCH]', etag='$etag': 412 Precondition failed".array2string($entry)); |
|
| 338 | + if ($this->debug) |
|
| 339 | + { |
|
| 340 | + error_log(__METHOD__."($method,path=$options[path],$id) HTTP_IF_MATCH='$_SERVER[HTTP_IF_MATCH]', etag='$etag': 412 Precondition failed".array2string($entry)); |
|
| 341 | + } |
|
| 321 | 342 | // honor Prefer: return=representation for 412 too (no need for client to explicitly reload) |
| 322 | 343 | $this->check_return_representation($options, $id); |
| 323 | 344 | return '412 Precondition Failed'; |
@@ -327,17 +348,26 @@ discard block |
||
| 327 | 348 | { |
| 328 | 349 | $if_none_match = $_SERVER['HTTP_IF_NONE_MATCH']; |
| 329 | 350 | // strip of quotes around etag, if they exist, that way we allow etag with and without quotes |
| 330 | - if ($if_none_match[0] == '"') $if_none_match = substr($if_none_match, 1, -1); |
|
| 351 | + if ($if_none_match[0] == '"') |
|
| 352 | + { |
|
| 353 | + $if_none_match = substr($if_none_match, 1, -1); |
|
| 354 | + } |
|
| 331 | 355 | |
| 332 | 356 | // if an IF_NONE_MATCH is given, check if we need to send a new export, or the current one is still up-to-date |
| 333 | 357 | if (in_array($method, array('GET','HEAD')) && $etag === $if_none_match) |
| 334 | 358 | { |
| 335 | - if ($this->debug) error_log(__METHOD__."($method,,$id) HTTP_IF_NONE_MATCH='$_SERVER[HTTP_IF_NONE_MATCH]', etag='$etag': 304 Not Modified"); |
|
| 359 | + if ($this->debug) |
|
| 360 | + { |
|
| 361 | + error_log(__METHOD__."($method,,$id) HTTP_IF_NONE_MATCH='$_SERVER[HTTP_IF_NONE_MATCH]', etag='$etag': 304 Not Modified"); |
|
| 362 | + } |
|
| 336 | 363 | return '304 Not Modified'; |
| 337 | 364 | } |
| 338 | 365 | if ($method == 'PUT' && ($if_none_match == '*' || $if_none_match == $etag)) |
| 339 | 366 | { |
| 340 | - if ($this->debug) error_log(__METHOD__."($method,,$id) HTTP_IF_NONE_MATCH='$_SERVER[HTTP_IF_NONE_MATCH]', etag='$etag': 412 Precondition failed"); |
|
| 367 | + if ($this->debug) |
|
| 368 | + { |
|
| 369 | + error_log(__METHOD__."($method,,$id) HTTP_IF_NONE_MATCH='$_SERVER[HTTP_IF_NONE_MATCH]', etag='$etag': 412 Precondition failed"); |
|
| 370 | + } |
|
| 341 | 371 | // honor Prefer: return=representation for 412 too (no need for client to explicitly reload) |
| 342 | 372 | $this->check_return_representation($options, $id); |
| 343 | 373 | return '412 Precondition Failed'; |
@@ -376,7 +406,10 @@ discard block |
||
| 376 | 406 | |
| 377 | 407 | if (($ret = $this->get($options, $id ? $id : $this->new_id, $user)) && !empty($options['data'])) |
| 378 | 408 | { |
| 379 | - if (!$this->caldav->use_compression()) header('Content-Length: '.$this->caldav->bytes($options['data'])); |
|
| 409 | + if (!$this->caldav->use_compression()) |
|
| 410 | + { |
|
| 411 | + header('Content-Length: '.$this->caldav->bytes($options['data'])); |
|
| 412 | + } |
|
| 380 | 413 | header('Content-Type: '.$options['mimetype']); |
| 381 | 414 | echo $options['data']; |
| 382 | 415 | } |
@@ -412,7 +445,10 @@ discard block |
||
| 412 | 445 | if (!array_key_exists($app,$handler_cache)) |
| 413 | 446 | { |
| 414 | 447 | $class = $app.'_groupdav'; |
| 415 | - if (!class_exists($class) && !class_exists($class = __NAMESPACE__.'\\'.ucfirst($app))) return null; |
|
| 448 | + if (!class_exists($class) && !class_exists($class = __NAMESPACE__.'\\'.ucfirst($app))) |
|
| 449 | + { |
|
| 450 | + return null; |
|
| 451 | + } |
|
| 416 | 452 | |
| 417 | 453 | $handler_cache[$app] = new $class($app, $groupdav); |
| 418 | 454 | } |
@@ -474,7 +510,10 @@ discard block |
||
| 474 | 510 | $matches = null; |
| 475 | 511 | if (preg_match('/address%20book\/([0-9.]+)/', $user_agent, $matches)) |
| 476 | 512 | { |
| 477 | - if ((int)$matches[1] < 868) $agent .= '_old'; |
|
| 513 | + if ((int)$matches[1] < 868) |
|
| 514 | + { |
|
| 515 | + $agent .= '_old'; |
|
| 516 | + } |
|
| 478 | 517 | } |
| 479 | 518 | break; |
| 480 | 519 | case 'kde': |
@@ -575,7 +614,10 @@ discard block |
||
| 575 | 614 | // --> as all clients dislike not getting an ETag for a PUT, we sending it again even not storing byte-by-byte |
| 576 | 615 | //if (get_class($this) == 'addressbook_groupdav' && in_array(self::get_agent(),array('thunderbird','lightning'))) |
| 577 | 616 | { |
| 578 | - if (is_null($etag)) $etag = $this->get_etag($entry); |
|
| 617 | + if (is_null($etag)) |
|
| 618 | + { |
|
| 619 | + $etag = $this->get_etag($entry); |
|
| 620 | + } |
|
| 579 | 621 | header('ETag: "'.$etag.'"'); |
| 580 | 622 | } |
| 581 | 623 | |
@@ -741,7 +783,10 @@ discard block |
||
| 741 | 783 | */ |
| 742 | 784 | public function get_sync_token($path, $user, $token=null) |
| 743 | 785 | { |
| 744 | - if (!isset($token)) $token = $this->getctag($path, $user); |
|
| 786 | + if (!isset($token)) |
|
| 787 | + { |
|
| 788 | + $token = $this->getctag($path, $user); |
|
| 789 | + } |
|
| 745 | 790 | |
| 746 | 791 | // never return current time, as more modifications might happen due to second granularity --> return 1sec less |
| 747 | 792 | if ($token >= (int)$GLOBALS['egw_info']['flags']['page_start_time']) |