diff --git a/admin.php b/admin.php index c548480..99841c8 100644 --- a/admin.php +++ b/admin.php @@ -45,6 +45,7 @@ if ( !$currentUser->isAdmin() ) { } @list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL; + if ( $action && strpos($_SERVER['HTTP_REFERER'], ROOT.'admin.php') === 0 // Prevent CSRF attacks @@ -61,7 +62,10 @@ if ( $action $bookmarkservice->deleteBookmarksForUser($uId); $tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user); - } + } + break; + case 'checkUrl' : + $tplVars['msg'] = checkUrl('http://fr3.php.net/manual/fr/function.get-headers.php')?"no pb": "ouille"; break; default: // DO NOTHING diff --git a/ajaxGetTitle.php b/ajaxGetTitle.php index 2bec47c..fc895db 100644 --- a/ajaxGetTitle.php +++ b/ajaxGetTitle.php @@ -43,7 +43,7 @@ function getTitle($url) { $encoding = strtoupper($matches[1][0]); // Convert to UTF-8 from the original encoding - if (function_exists("mb_convert_encoding") { + if (function_exists("mb_convert_encoding")) { $title = @mb_convert_encoding($title, 'UTF-8', $encoding); } diff --git a/functions.inc.php b/functions.inc.php index 965b120..84f79c7 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -95,6 +95,19 @@ function shortenString($string, $maxSize=75) { return $output; } +/* Check online if a url is a valid page (Not a 404 error for example) */ +function checkUrl($url) { + $h = @get_headers($url); + + //look if the page doesn't return a void or 40X or 50X HTTP code error + if(is_array($h) && strpos($h[0], '40') === false && strpos($h[0], '50') === false) { + return true; + } else { + return false; + } +} + + function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '', $db = NULL) { if(defined('HAS_DIED')) die(T_('message_die() was called multiple times.')); diff --git a/gsearch/context.php b/gsearch/context.php index 1a65063..bed474d 100644 --- a/gsearch/context.php +++ b/gsearch/context.php @@ -1,4 +1,11 @@ - + diff --git a/templates/userlist.tpl.php b/templates/userlist.tpl.php index 85c1998..fdccc62 100644 --- a/templates/userlist.tpl.php +++ b/templates/userlist.tpl.php @@ -23,8 +23,12 @@ foreach($users as $user) { } echo ''."\n"; -} - +} +?> +

+ + +includeTemplate('sidebar.tpl'); $this->includeTemplate($GLOBALS['bottom_include']);