}\r
\r
@list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
+
\r
if ( $action
&& strpos($_SERVER['HTTP_REFERER'], ROOT.'admin.php') === 0 // Prevent CSRF attacks
$bookmarkservice->deleteBookmarksForUser($uId);\r
\r
$tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user);\r
- }\r
+ }
+ break;
+ case 'checkUrl' :
+ $tplVars['msg'] = checkUrl('http://fr3.php.net/manual/fr/function.get-headers.php')?"no pb": "ouille";\r
break;\r
default:\r
// DO NOTHING\r
$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);
}
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.'));
-<?php require_once('../header.inc.php');?>
+<?php
+if($GLOBALS['enableGoogleCustomSearch']==false) {
+ echo "Google Custom Search disabled. You can enable it into the config.inc.php file.";
+ die;
+}
+
+require_once('../header.inc.php');
+?>
<!--?xml version="1.0" encoding="UTF-8" ?-->
<GoogleCustomizations>
}\r
\r
echo '</li>'."\n";\r
-}\r
-\r
+}
+?>
+<h3><?php echo T_('Check consistancy')?></h3>
+<a href="<?php echo createURL('admin','checkUrl/') ?>"> <?php echo T_('Check all urls') ?></a>
+
+<?php\r
$this->includeTemplate('sidebar.tpl');\r
$this->includeTemplate($GLOBALS['bottom_include']);\r
\r