From b818ffae24857f39a57c7c43dea2c9aa87815368 Mon Sep 17 00:00:00 2001 From: mensonge Date: Wed, 3 Dec 2008 13:24:17 +0000 Subject: [PATCH] New Feature: admin can check urls validity git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@190 b3834d28-1941-0410-a4f8-b48e95affb8f --- admin.php | 13 ++++++++++--- templates/admin.tpl.php | 39 +++++++++++++++++++++++++++++++++++++++ templates/top.inc.php | 2 +- 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 templates/admin.tpl.php diff --git a/admin.php b/admin.php index 99841c8..fa2c3db 100644 --- a/admin.php +++ b/admin.php @@ -32,7 +32,9 @@ $currentUser = $userservice->getCurrentObjectUser(); // Header variables $tplVars['subtitle'] = T_('Manage users'); $tplVars['loadjs'] = true; -$tplVars['sidebar_blocks'] = array('users' ); +$tplVars['sidebar_blocks'] = array('users' ); +$tplVars['error'] = ''; +$tplVars['msg'] = ''; if ( !$userservice->isLoggedOn() ) { header('Location: '. createURL('login', '')); @@ -65,14 +67,19 @@ if ( $action } break; case 'checkUrl' : - $tplVars['msg'] = checkUrl('http://fr3.php.net/manual/fr/function.get-headers.php')?"no pb": "ouille"; + $bookmarks =& $bookmarkservice->getBookmarks(0, NULL, NULL, NULL, NULL, getSortOrder()); + foreach($bookmarks['bookmarks'] as $bookmark) { + if(!checkUrl($bookmark['bAddress'])) { + $tplVars['error'].= T_('Problem with ').$bookmark['bAddress'].' ('. $bookmark['username'] .')
'; + } + } break; default: // DO NOTHING } } -$templatename = 'userlist.tpl'; +$templatename = 'admin.tpl'; $users =& $userservice->getObjectUsers(); if ( !is_array($users) ) { diff --git a/templates/admin.tpl.php b/templates/admin.tpl.php new file mode 100644 index 0000000..6e5773b --- /dev/null +++ b/templates/admin.tpl.php @@ -0,0 +1,39 @@ +getCurrentObjectUser(); + +$this->includeTemplate($GLOBALS['top_include']); + +echo '

'.T_('Users management').'

'; + +echo '
    '; + +foreach($users as $user) { + echo '
  1. '."\n"; + + echo ''; + + if($user->getUsername() != $currentObjectUser->getUsername()) { + echo '
    '; + echo ''.T_('Delete').''; + echo '
    '; + } + + echo '
  2. '."\n"; +} +echo '
'; +?> +

+

+ +

+includeTemplate('sidebar.tpl'); +$this->includeTemplate($GLOBALS['bottom_include']); + +?> diff --git a/templates/top.inc.php b/templates/top.inc.php index d2f05ea..55f0aaa 100644 --- a/templates/top.inc.php +++ b/templates/top.inc.php @@ -47,7 +47,7 @@ if(!isset($_GET['popup'])) { if (isset($subtitle)) { echo '

'. $subtitle ."

\n"; } -if (isset($error) && $msg!='') { +if (isset($error) && $error!='') { echo '

'. $error ."

\n"; } if (isset($msg) && $msg!='') {