Major Refactoring: finish transforming into object . Put and into header.inc.php.
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@199 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
f7ccbde310
commit
d6889066c0
68 changed files with 119 additions and 294 deletions
|
@ -20,10 +20,7 @@
|
|||
|
||||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
|
||||
$tplVars = array();
|
||||
$tplVars['subtitle'] = T_('About');
|
||||
|
||||
$templateservice->loadTemplate('about.tpl', $tplVars);
|
||||
?>
|
|
@ -20,14 +20,9 @@
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
$bookmark2tagservice = & ServiceFactory :: getServiceInstance('Bookmark2Tagservice');
|
||||
$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
|
||||
$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
|
||||
/* Managing current logged user */
|
||||
$currentUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
// Header variables
|
||||
$tplVars['subtitle'] = T_('Manage users');
|
||||
|
|
|
@ -26,7 +26,6 @@ require_once('../header.inc.php');
|
|||
/* Service creation: only useful services are created */
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$tagstatservice =& ServiceFactory::getServiceInstance('TagStatService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
|
|
@ -23,23 +23,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$loggedon = true;
|
||||
$currentUser = $userservice->getCurrentUser();
|
||||
$currentUserID = $userservice->getCurrentUserId();
|
||||
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
{identifier:"tag",
|
||||
items: [
|
||||
<?php
|
||||
$listTags = $b2tservice->getPopularTags($currentUserID, 1000, $currentUserID);
|
||||
$listTags = $b2tservice->getPopularTags($userservice->getCurrentUserId(), 1000, $userservice->getCurrentUserId());
|
||||
foreach($listTags as $t) {
|
||||
echo "{tag: \"".$t['tag']."\"},";
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ header("Cache-Control: no-cache, must-revalidate");
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
//No specific services
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_GET['username']) ? define('GET_USERNAME', $_GET['username']): define('GET_USERNAME', '');
|
||||
|
|
|
@ -22,9 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
|
||||
|
@ -48,7 +46,6 @@ if ($usecache) {
|
|||
}
|
||||
|
||||
// Header variables
|
||||
$tplvars = array();
|
||||
$pagetitle = T_('All Tags');
|
||||
|
||||
if (isset($user) && $user != '') {
|
||||
|
|
|
@ -12,8 +12,9 @@ if($GLOBALS['enableGoogleCustomSearch'] == false) {
|
|||
die;
|
||||
}
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
/*
|
||||
// Restrict to admins?
|
||||
|
@ -36,8 +37,6 @@ $tag = NULL;
|
|||
// Get the posts relevant to the passed-in variables.
|
||||
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, NULL, $tag, NULL, getSortOrder());
|
||||
|
||||
$currentuser = $userservice->getCurrentUser();
|
||||
$currentusername = $currentuser[$userservice->getFieldName('username')];
|
||||
|
||||
// Set up the plain file and output all the posts.
|
||||
header('Content-Type: text/plain');
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
// Check to see if a tag was specified.
|
||||
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
|
||||
|
@ -20,8 +20,6 @@ else
|
|||
// Get the posts relevant to the passed-in variables.
|
||||
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());
|
||||
|
||||
$currentuser = $userservice->getCurrentUser();
|
||||
$currentusername = $currentuser[$userservice->getFieldName('username')];
|
||||
|
||||
// Set up the XML file and output all the posts.
|
||||
header('Content-Type: text/html');
|
||||
|
@ -29,7 +27,7 @@ echo '<!DOCTYPE NETSCAPE-Bookmark-file-1>'."\r\n";
|
|||
echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">';
|
||||
echo '<!-- This is an automatically generated file. -->'."\r\n";
|
||||
echo '<TITLE>Bookmarks</TITLE>'."\r\n";
|
||||
echo '<H1 LAST_MODIFIED="'. date('U') .'">Bookmarks for '. htmlspecialchars($currentusername) .''. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') ." from " . $sitename ."</H1>\r\n";
|
||||
echo '<H1 LAST_MODIFIED="'. date('U') .'">Bookmarks for '. htmlspecialchars($currentUser->getUsername()) .''. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') ." from " . $sitename ."</H1>\r\n";
|
||||
echo '<DL><p>'."\r\n";
|
||||
|
||||
|
||||
|
|
|
@ -1,37 +1,33 @@
|
|||
<?php
|
||||
require_once('../header.inc.php');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
// Provides HTTP Basic authentication of a user, and sets two variables, sId and username,
|
||||
// with the user's info.
|
||||
|
||||
function authenticate() {
|
||||
header('WWW-Authenticate: Basic realm="SemanticScuttle API"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
header('WWW-Authenticate: Basic realm="SemanticScuttle API"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
|
||||
die(T_("Use of the API calls requires authentication."));
|
||||
die(T_("Use of the API calls requires authentication."));
|
||||
}
|
||||
|
||||
if(!$userservice->isLoggedOn()) {
|
||||
/* Maybe we have caught authentication data in $_SERVER['REMOTE_USER']
|
||||
( Inspired by http://www.yetanothercommunitysystem.com/article-321-regle-comment-utiliser-l-authentification-http-en-php-chez-ovh ) */
|
||||
if((!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']))
|
||||
&& preg_match('/Basic\s+(.*)$/i', $_SERVER['REMOTE_USER'], $matches)) {
|
||||
list($name, $password) = explode(':', base64_decode($matches[1]));
|
||||
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
|
||||
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
|
||||
}
|
||||
|
||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
authenticate();
|
||||
} else {
|
||||
require_once('../header.inc.php');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
$login = $userservice->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
|
||||
if (!$login) {
|
||||
authenticate();
|
||||
/* Maybe we have caught authentication data in $_SERVER['REMOTE_USER']
|
||||
( Inspired by http://www.yetanothercommunitysystem.com/article-321-regle-comment-utiliser-l-authentification-http-en-php-chez-ovh ) */
|
||||
if((!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']))
|
||||
&& preg_match('/Basic\s+(.*)$/i', $_SERVER['REMOTE_USER'], $matches)) {
|
||||
list($name, $password) = explode(':', base64_decode($matches[1]));
|
||||
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
|
||||
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
|
||||
}
|
||||
|
||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
authenticate();
|
||||
} else {
|
||||
$login = $userservice->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
|
||||
if (!$login) {
|
||||
authenticate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
// Get all the bookmark's passed-in information
|
||||
if (isset($_REQUEST['url']) && (trim($_REQUEST['url']) != ''))
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
// Check to see if a tag was specified.
|
||||
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
|
||||
|
@ -20,13 +21,10 @@ else
|
|||
// Get the posts relevant to the passed-in variables.
|
||||
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag);
|
||||
|
||||
$currentuser = $userservice->getCurrentUser();
|
||||
$currentusername = $currentuser[$userservice->getFieldName('username')];
|
||||
|
||||
// Set up the XML file and output all the posts.
|
||||
header('Content-Type: text/xml');
|
||||
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
|
||||
echo '<posts update="'. gmdate('Y-m-d\TH:i:s\Z') .'" user="'. htmlspecialchars($currentusername) .'"'. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') .">\r\n";
|
||||
echo '<posts update="'. gmdate('Y-m-d\TH:i:s\Z') .'" user="'. htmlspecialchars($currentUser->getUsername()) .'"'. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') .">\r\n";
|
||||
|
||||
foreach($bookmarks['bookmarks'] as $row) {
|
||||
if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
// Check to see if a tag was specified.
|
||||
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
|
||||
|
@ -18,13 +19,10 @@ else
|
|||
// Get the posts relevant to the passed-in variables.
|
||||
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag);
|
||||
|
||||
$currentuser = $userservice->getCurrentUser();
|
||||
$currentusername = $currentuser[$userservice->getFieldName('username')];
|
||||
|
||||
// Set up the XML file and output all the tags.
|
||||
header('Content-Type: text/xml');
|
||||
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
|
||||
echo '<dates tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentusername, 'xml') ."\">\r\n";
|
||||
echo '<dates tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentUser->getUsername(), 'xml') ."\">\r\n";
|
||||
|
||||
$lastdate = NULL;
|
||||
foreach($bookmarks['bookmarks'] as $row) {
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
// Note that del.icio.us only errors out if no URL was passed in; there's no error on attempting
|
||||
// to delete a bookmark you don't have.
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
// Check to see if a tag was specified.
|
||||
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
|
||||
|
@ -32,13 +33,11 @@ $dtend = date('Y-m-d H:i:s', strtotime($dtstart .'+1 day'));
|
|||
// Get the posts relevant to the passed-in variables.
|
||||
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, NULL, NULL, $dtstart, $dtend);
|
||||
|
||||
$currentuser = $userservice->getCurrentUser();
|
||||
$currentusername = $currentuser[$userservice->getFieldName('username')];
|
||||
|
||||
// Set up the XML file and output all the tags.
|
||||
header('Content-Type: text/xml');
|
||||
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
|
||||
echo '<posts'. (is_null($dtstart) ? '' : ' dt="'. $dtstart .'"') .' tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentusername, 'xml') ."\">\r\n";
|
||||
echo '<posts'. (is_null($dtstart) ? '' : ' dt="'. $dtstart .'"') .' tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentUser->getUsername(), 'xml') ."\">\r\n";
|
||||
|
||||
foreach($bookmarks['bookmarks'] as $row) {
|
||||
if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
|
||||
|
|
|
@ -10,8 +10,9 @@ $countMax = 100;
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
// Check to see if a tag was specified.
|
||||
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
|
||||
|
@ -33,13 +34,11 @@ if (isset($_REQUEST['count']) && (intval($_REQUEST['count']) != 0)) {
|
|||
// Get the posts relevant to the passed-in variables.
|
||||
$bookmarks =& $bookmarkservice->getBookmarks(0, $count, $userservice->getCurrentUserId(), $tag);
|
||||
|
||||
$currentuser = $userservice->getCurrentUser();
|
||||
$currentusername = $currentuser[$userservice->getFieldName('username')];
|
||||
|
||||
// Set up the XML file and output all the tags.
|
||||
header('Content-Type: text/xml');
|
||||
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
|
||||
echo '<posts tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentusername, 'xml') ."\">\r\n";
|
||||
echo '<posts tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentUser->getUsername(), 'xml') ."\">\r\n";
|
||||
|
||||
foreach($bookmarks['bookmarks'] as $row) {
|
||||
if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
|
||||
|
|
|
@ -8,14 +8,13 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
// Get the posts relevant to the passed-in variables.
|
||||
$bookmarks =& $bookmarkservice->getBookmarks(0, 1, $userservice->getCurrentUserId());
|
||||
|
||||
$currentuser = $userservice->getCurrentUser();
|
||||
$currentusername = $currentuser[$userservice->getFieldName('username')];
|
||||
|
||||
// Set up the XML file and output all the tags.
|
||||
header('Content-Type: text/xml');
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
// Get the tags relevant to the passed-in variables.
|
||||
$tags =& $b2tservice->getTags($userservice->getCurrentUserId());
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
require_once('httpauth.inc.php');
|
||||
require_once('../header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
// Get the tag info.
|
||||
if (isset($_REQUEST['old']) && (trim($_REQUEST['old']) != ''))
|
||||
|
|
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
$cdservice = & ServiceFactory :: getServiceInstance('CommonDescriptionService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
@ -47,11 +45,9 @@ if(!isset($_POST['referrer'])) {
|
|||
list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']);
|
||||
$template = 'bookmarkcommondescriptionedit.tpl';
|
||||
|
||||
//$logged_on_user = $userservice->getCurrentUser();
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
//permissions
|
||||
if(is_null($currentObjectUser)) {
|
||||
if(is_null($currentUser)) {
|
||||
$tplVars['error'] = T_('Permission denied.');
|
||||
$templateservice->loadTemplate('error.500.tpl', $tplVars);
|
||||
exit();
|
||||
|
@ -59,7 +55,7 @@ if(is_null($currentObjectUser)) {
|
|||
|
||||
if (POST_CONFIRM) {
|
||||
if (strlen($hash)>0 &&
|
||||
$cdservice->addBookmarkDescription(POST_HASH, stripslashes(POST_TITLE), stripslashes(POST_DESCRIPTION), $currentObjectUser->getId(), time())
|
||||
$cdservice->addBookmarkDescription(POST_HASH, stripslashes(POST_TITLE), stripslashes(POST_DESCRIPTION), $currentUser->getId(), time())
|
||||
) {
|
||||
$tplVars['msg'] = T_('Bookmark common description updated');
|
||||
header('Location: '. POST_REFERRER);
|
||||
|
@ -68,7 +64,6 @@ if (POST_CONFIRM) {
|
|||
$template = 'error.500.tpl';
|
||||
}
|
||||
} elseif (POST_CANCEL) {
|
||||
$logged_on_user = $userservice->getCurrentUser();
|
||||
header('Location: '. POST_REFERRER);
|
||||
} else {
|
||||
$bkm = $bookmarkservice->getBookmarkByHash($hash);
|
||||
|
|
|
@ -23,12 +23,8 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_GET['action']) ? define('GET_ACTION', $_GET['action']): define('GET_ACTION', '');
|
||||
isset($_POST['submitted']) ? define('POST_SUBMITTED', $_POST['submitted']): define('POST_SUBMITTED', '');
|
||||
|
@ -59,12 +55,9 @@ if ((GET_ACTION == "add") && !$userservice->isLoggedOn()) {
|
|||
}
|
||||
|
||||
if ($userservice->isLoggedOn()) {
|
||||
//$currentUser = $userservice->getCurrentUser();
|
||||
//$currentUserID = $userservice->getCurrentUserId();
|
||||
//$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
$currentUserID = $currentObjectUser->getId();
|
||||
$currentUsername = $currentObjectUser->getUsername();
|
||||
$currentUser = $userservice->getCurrentObjectUser();
|
||||
$currentUserID = $currentUser->getId();
|
||||
$currentUsername = $currentUser->getUsername();
|
||||
}
|
||||
|
||||
|
||||
|
@ -197,7 +190,7 @@ if ($templatename == 'editbookmark.tpl') {
|
|||
}
|
||||
} else if ($user && GET_POPUP == '') {
|
||||
|
||||
$tplVars['sidebar_blocks'] = array('profile', 'watchstatus');
|
||||
$tplVars['sidebar_blocks'] = array('watchstatus');
|
||||
|
||||
if (!$cat) {
|
||||
$cat = NULL;
|
||||
|
|
9
edit.php
9
edit.php
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['submitted']) ? define('POST_SUBMITTED', $_POST['submitted']): define('POST_SUBMITTED', '');
|
||||
|
@ -40,9 +38,6 @@ isset($_GET['popup']) ? define('GET_POPUP', $_GET['popup']): define('GET_POPUP',
|
|||
isset($_POST['popup']) ? define('POST_POPUP', $_POST['popup']): define('POST_POPUP', '');
|
||||
isset($_POST['referrer']) ? define('POST_REFERRER', $_POST['referrer']): define('POST_REFERRER', '');
|
||||
|
||||
/* Managing current logged user */
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
|
||||
// Header variables
|
||||
$tplVars['subtitle'] = T_('Edit Bookmark');
|
||||
|
@ -81,7 +76,7 @@ if (!($row = $bookmarkservice->getBookmark(intval($bookmark), true))) {
|
|||
header('Location: '. POST_REFERRER);
|
||||
} else {
|
||||
$tplVars['msg'] = T_('Bookmark saved');
|
||||
header('Location: '. createURL('bookmarks', $currentObjectUser->getUsername()));
|
||||
header('Location: '. createURL('bookmarks', $currentUser->getUsername()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +87,7 @@ if (!($row = $bookmarkservice->getBookmark(intval($bookmark), true))) {
|
|||
if (POST_REFERRER != '') {
|
||||
header('Location: '. POST_REFERRER);
|
||||
} else {
|
||||
header('Location: '. createURL('bookmarks', $currentObjectUser->getUsername()));
|
||||
header('Location: '. createURL('bookmarks', $currentUser->getUsername()));
|
||||
}
|
||||
exit();
|
||||
} else {
|
||||
|
|
|
@ -5,8 +5,6 @@ if($GLOBALS['enableGoogleCustomSearch']==false) {
|
|||
die;
|
||||
}
|
||||
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
$currentUser = $userservice->getCurrentObjectUser();
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
|
|
@ -37,7 +37,15 @@ T_bindtextdomain($domain, dirname(__FILE__) .'/locales');
|
|||
T_bind_textdomain_codeset($domain, 'UTF-8');
|
||||
T_textdomain($domain);
|
||||
|
||||
|
||||
// 4 // Session
|
||||
session_start();
|
||||
|
||||
// 5 // Create mandatory services and objects
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$currentUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$tplVars = array();
|
||||
$tplVars['currentUser'] = $currentUser;
|
||||
$tplVars['userservice'] = $userservice;
|
||||
?>
|
||||
|
|
15
history.php
15
history.php
|
@ -23,32 +23,21 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0);
|
||||
isset($_GET['sort']) ? define('GET_SORT', $_GET['sort']): define('GET_SORT', '');
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
@list($url, $hash) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
|
||||
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
/*$loggedon = false;
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$loggedon = true;
|
||||
$currentUser = $userservice->getCurrentUser();
|
||||
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
||||
}*/
|
||||
|
||||
if ($usecache) {
|
||||
// Generate hash for caching on
|
||||
$hashtext = $_SERVER['REQUEST_URI'];
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$hashtext .= $currentObjectUser->getUsername();
|
||||
$hashtext .= $currentUser->getUsername();
|
||||
}
|
||||
$cachehash = md5($hashtext);
|
||||
|
||||
|
@ -85,7 +74,7 @@ if ($bookmark =& $bookmarkservice->getBookmarkByHash($hash)) {
|
|||
$tplVars['nav_url'] = createURL('history', $hash .'/%3$s');
|
||||
$tplVars['rsschannels'] = array();
|
||||
if($userservice->isLoggedOn()) {
|
||||
$tplVars['user'] = $currentObjectUser->getUsername();
|
||||
$tplVars['user'] = $currentUser->getUsername();
|
||||
} else {
|
||||
$tplVars['user'] = '';
|
||||
}
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
|
||||
// No specific services
|
||||
|
||||
/* Managing all possible inputs */
|
||||
// First input is $_FILES
|
||||
|
@ -32,8 +30,6 @@ $templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
|||
isset($_POST['status']) ? define('POST_STATUS', $_POST['status']): define('POST_STATUS', '');
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['size'] > 0) {
|
||||
$userinfo = $userservice->getCurrentObjectUser();
|
||||
|
||||
|
@ -72,7 +68,6 @@ function startElement($parser, $name, $attrs) {
|
|||
global $depth, $status, $tplVars, $userservice;
|
||||
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
if ($name == 'POST') {
|
||||
while(list($attrTitle, $attrVal) = each($attrs)) {
|
||||
|
|
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
@ -32,8 +30,6 @@ $templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
|||
// Other inputs
|
||||
isset($_POST['status']) ? define('POST_STATUS', $_POST['status']): define('POST_STATUS', '');
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
$countImportedBookmarks = 0;
|
||||
$tplVars['msg'] = '';
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
|
||||
|
||||
/* Managing current logged user */
|
||||
|
@ -33,8 +31,6 @@ $currentUser = $userservice->getCurrentObjectUser();
|
|||
/* Managing all possible inputs */
|
||||
// First input is $_FILES
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
$tplVars['msg'] = '';
|
||||
|
||||
if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['size'] > 0) {
|
||||
|
|
|
@ -24,8 +24,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
@ -35,7 +33,6 @@ isset($_GET['sort']) ? define('GET_SORT', $_GET['sort']): define('GET_SORT', '')
|
|||
|
||||
|
||||
// Logout action
|
||||
$tplvars = array();
|
||||
if (GET_ACTION == "logout") {
|
||||
$userservice->logout();
|
||||
$tplvars['msg'] = T_('You have now logged out');
|
||||
|
|
|
@ -23,8 +23,7 @@ require_once('header.inc.php');
|
|||
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
// No specific services
|
||||
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
@ -34,9 +33,6 @@ isset($_POST['username']) ? define('POST_USERNAME', $_POST['username']): define(
|
|||
isset($_POST['password']) ? define('POST_PASSWORD', $_POST['password']): define('POST_PASSWORD', '');
|
||||
isset($_POST['query']) ? define('POST_QUERY', $_POST['query']): define('POST_QUERY', '');
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
$keeppass = (POST_KEEPPASS=='yes')?true:false;
|
||||
|
||||
$login = false;
|
||||
|
|
|
@ -21,17 +21,13 @@
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
// No specific services
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['submitted']) ? define('POST_SUBMITTED', $_POST['submitted']): define('POST_SUBMITTED', '');
|
||||
isset($_POST['username']) ? define('POST_USERNAME', $_POST['username']): define('POST_USERNAME', '');
|
||||
isset($_POST['email']) ? define('POST_EMAIL', $_POST['email']): define('POST_EMAIL', '');
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
// IF SUBMITTED
|
||||
if (POST_SUBMITTED != '') {
|
||||
|
||||
|
|
|
@ -22,14 +22,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
/* Managing current logged user */
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
|
||||
list($url, $user) = explode('/', $_SERVER['PATH_INFO']);
|
||||
|
||||
|
@ -37,8 +32,8 @@ if ($usecache) {
|
|||
// Generate hash for caching on
|
||||
$hashtext = $_SERVER['REQUEST_URI'];
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$hashtext .= $currentObjectUser->getId();
|
||||
if ($currentObjectUser->getUsername() == $user) {
|
||||
$hashtext .= $currentUser->getId();
|
||||
if ($currentUser->getUsername() == $user) {
|
||||
$hashtext .= $user;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +44,6 @@ if ($usecache) {
|
|||
}
|
||||
|
||||
// Header variables
|
||||
$tplvars = array();
|
||||
$pagetitle = T_('Popular Tags');
|
||||
|
||||
if (isset($user) && $user != '') {
|
||||
|
|
15
profile.php
15
profile.php
|
@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
// No specific services
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['submitted']) ? define('POST_SUBMITTED', $_POST['submitted']): define('POST_SUBMITTED', '');
|
||||
|
@ -39,12 +38,6 @@ isset($_SESSION['token']) ? define('SESSION_TOKEN', $_SESSION['token']): define(
|
|||
isset($_SESSION['token_stamp']) ? define('SESSION_TOKENSTAMP', $_SESSION['token_stamp']): define('SESSION_TOKENSTAMP', '');
|
||||
|
||||
|
||||
/* Managing current logged user */
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
@list($url, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
|
||||
|
||||
if ($user) {
|
||||
|
@ -67,7 +60,7 @@ if ($user) {
|
|||
exit();
|
||||
}
|
||||
|
||||
if ($userservice->isLoggedOn() && $user == $currentObjectUser->getUsername()) {
|
||||
if ($userservice->isLoggedOn() && $user == $currentUser->getUsername()) {
|
||||
$title = T_('My Profile');
|
||||
} else {
|
||||
$title = T_('Profile') .': '. $user;
|
||||
|
@ -78,7 +71,7 @@ $tplVars['subtitle'] = $title;
|
|||
$tplVars['user'] = $user;
|
||||
$tplVars['userid'] = $userid;
|
||||
|
||||
if (POST_SUBMITTED!='' && $currentObjectUser->getId() == $userid) {
|
||||
if (POST_SUBMITTED!='' && $currentUser->getId() == $userid) {
|
||||
$error = false;
|
||||
$detPass = trim(POST_PASS);
|
||||
$detPassConf = trim(POST_PASSCONF);
|
||||
|
@ -117,7 +110,7 @@ if (POST_SUBMITTED!='' && $currentObjectUser->getId() == $userid) {
|
|||
$userinfo = $userservice->getObjectUserByUsername($user);
|
||||
}
|
||||
|
||||
if (!$userservice->isLoggedOn() || $currentObjectUser->getId() != $userid) {
|
||||
if (!$userservice->isLoggedOn() || $currentUser->getId() != $userid) {
|
||||
$templatename = 'profile.tpl.php';
|
||||
} else {
|
||||
//Token Init
|
||||
|
|
|
@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
// No specific services
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['submitted']) ? define('POST_SUBMITTED', $_POST['submitted']): define('POST_SUBMITTED', '');
|
||||
|
@ -33,8 +32,6 @@ isset($_POST['email']) ? define('POST_MAIL', $_POST['email']): define('POST_MAIL
|
|||
isset($_POST['antispamAnswer']) ? define('POST_ANTISPAMANSWER', $_POST['antispamAnswer']): define('POST_ANTISPAMANSWER', '');
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
if (POST_SUBMITTED != '') {
|
||||
$posteduser = trim(utf8_strtolower(POST_USERNAME));
|
||||
|
||||
|
|
8
rss.php
8
rss.php
|
@ -24,12 +24,8 @@ require_once('header.inc.php');
|
|||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
|
||||
$tplVars = array();
|
||||
header('Content-Type: application/xml');
|
||||
if(isset($_SERVER['PATH_INFO']) && strlen($_SERVER['PATH_INFO']) >1) {
|
||||
list($url, $user, $cat) = explode('/', $_SERVER['PATH_INFO']);
|
||||
|
@ -44,9 +40,7 @@ if ($usecache) {
|
|||
$hashtext = $_SERVER['REQUEST_URI'];
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$hashtext .= $userservice->getCurrentUserID();
|
||||
$currentUser = $userservice->getCurrentUser();
|
||||
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
||||
if ($currentUsername == $user) {
|
||||
if ($currentUser->getUsername() == $user) {
|
||||
$hashtext .= $user;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,8 +37,6 @@ if (POST_TERMS != '') {
|
|||
} else {
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$searchhistoryservice =& ServiceFactory::getServiceInstance('SearchHistoryService');
|
||||
|
||||
/* Managing current logged user */
|
||||
|
@ -53,7 +51,6 @@ if (POST_TERMS != '') {
|
|||
$page= NULL;
|
||||
}
|
||||
|
||||
$tplvars = array();
|
||||
$tplVars['loadjs'] = true;
|
||||
|
||||
// Pagination
|
||||
|
|
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
|
||||
|
@ -33,8 +31,6 @@ isset($_POST['tag1']) ? define('POST_TAG1', $_POST['tag1']): define('POST_TAG1',
|
|||
isset($_POST['linkType']) ? define('POST_LINKTYPE', $_POST['linkType']): define('POST_LINKTYPE', '');
|
||||
isset($_POST['tag2']) ? define('POST_TAG2', $_POST['tag2']): define('POST_TAG2', '');
|
||||
|
||||
/* Managing current logged user */
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
//permissions
|
||||
if(!$userservice->isLoggedOn()) {
|
||||
|
@ -50,19 +46,19 @@ if (POST_CONFIRM != '') {
|
|||
$tag1 = POST_TAG1;
|
||||
$linkType = POST_LINKTYPE;
|
||||
$tag2 = POST_TAG2;
|
||||
if ($tag2tagservice->addLinkedTags($tag1, $tag2, $linkType, $currentObjectUser->getId())) {
|
||||
if ($tag2tagservice->addLinkedTags($tag1, $tag2, $linkType, $currentUser->getId())) {
|
||||
$tplVars['msg'] = T_('Tag link created');
|
||||
header('Location: '. createURL('bookmarks', $currentObjectUser->getUsername()));
|
||||
header('Location: '. createURL('bookmarks', $currentUser->getUsername()));
|
||||
} else {
|
||||
$tplVars['error'] = T_('Failed to create the link');
|
||||
$templateservice->loadTemplate('error.500.tpl', $tplVars);
|
||||
exit();
|
||||
}
|
||||
} elseif (POST_CANCEL) {
|
||||
header('Location: '. createURL('bookmarks', $currentObjectUser->getUsername() .'/'. $tags));
|
||||
header('Location: '. createURL('bookmarks', $currentUser->getUsername() .'/'. $tags));
|
||||
}
|
||||
|
||||
$tplVars['links'] = $tag2tagservice->getLinks($currentObjectUser->getId());
|
||||
$tplVars['links'] = $tag2tagservice->getLinks($currentUser->getId());
|
||||
|
||||
$tplVars['tag1'] = $tag1;
|
||||
$tplVars['tag2'] = '';
|
||||
|
|
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
|
||||
|
|
|
@ -23,18 +23,13 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_SERVER['HTTP_REFERER']) ? define('HTTP_REFERER', $_SERVER['HTTP_REFERER']): define('HTTP_REFERER', '');
|
||||
|
||||
/* Managing current logged user */
|
||||
$logged_on_user = $userservice->getCurrentUser();
|
||||
|
||||
|
||||
//permissions
|
||||
if($logged_on_user == null) {
|
||||
if(!$userservice->loggedOn()) {
|
||||
$tplVars['error'] = T_('Permission denied.');
|
||||
$templateservice->loadTemplate('error.500.tpl', $tplVars);
|
||||
exit();
|
||||
|
|
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
$cdservice = & ServiceFactory :: getServiceInstance('CommonDescriptionService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
|
|
@ -23,8 +23,7 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
|
||||
|
|
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$tagservice = & ServiceFactory :: getServiceInstance('TagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
|
||||
|
|
|
@ -25,8 +25,6 @@ require_once('header.inc.php');
|
|||
$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
|
||||
$tagservice = & ServiceFactory :: getServiceInstance('TagService');
|
||||
$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2tagService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
|
||||
|
|
4
tags.php
4
tags.php
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
@ -37,8 +35,6 @@ $currentUser = $userservice->getCurrentObjectUser();
|
|||
/* Managing path info */
|
||||
list($url, $cat) = explode('/', $_SERVER['PATH_INFO']);
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
|
||||
if (!$cat) {
|
||||
header('Location: '. createURL('populartags'));
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
<?php
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
//$currentUser = $userservice->getCurrentUser();
|
||||
//$currentUserId = $userservice->getCurrentUserId();
|
||||
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
$this->includeTemplate($GLOBALS['top_include']);
|
||||
?>
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
$this->includeTemplate($GLOBALS['top_include']);
|
||||
|
||||
echo '<h3>'.T_('Users management').'</h3>';
|
||||
|
@ -18,7 +13,7 @@ foreach($users as $user) {
|
|||
echo '<a href="'.createURL('profile', $user->getUsername()).'">'.$user->getUsername().'</a>';
|
||||
echo '</div>';
|
||||
|
||||
if($user->getUsername() != $currentObjectUser->getUsername()) {
|
||||
if($user->getUsername() != $currentUser->getUsername()) {
|
||||
echo '<div class="meta">';
|
||||
echo '<a href="'.createURL('admin','delete/'.$user->getUsername()).'" onclick="return confirm(\''.T_('Are you sure?').'\');">'.T_('Delete').'</a>';
|
||||
echo '</div>';
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
$this->includeTemplate($GLOBALS['top_include']);
|
||||
|
||||
|
@ -47,7 +45,6 @@ window.onload = function() {
|
|||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<?php if (isset($referrer)): ?>
|
||||
<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div>
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
<?php
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$tagservice =& ServiceFactory::getServiceInstance('TagService');
|
||||
$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
|
||||
|
||||
// Momentary useful to go to object code
|
||||
$currentObjectUser = $userservice->getCurrentObjectUser();
|
||||
|
||||
$pageName = isset($pageName)?$pageName:"";
|
||||
$user = isset($user)?$user:"";
|
||||
|
@ -94,7 +91,7 @@ if(isset($currenttag) && $currenttag!= '') {
|
|||
//echo T_(' for these tags');
|
||||
} else if($userservice->isLoggedOn()){
|
||||
echo ' - ';
|
||||
echo '<a href="'. createURL('bookmarks', $currentObjectUser->getUsername().'/'.$currenttag) .'">';
|
||||
echo '<a href="'. createURL('bookmarks', $currentUser->getUsername().'/'.$currenttag) .'">';
|
||||
echo T_('Only your bookmarks for this tag').'</a>';
|
||||
//echo T_(' for these tags');
|
||||
}
|
||||
|
@ -165,9 +162,9 @@ if(isset($currenttag) && $currenttag!= '') {
|
|||
|
||||
// Copy link
|
||||
if ($userservice->isLoggedOn()
|
||||
&& ($currentObjectUser->getId() != $row['uId'])
|
||||
&& !$bookmarkservice->bookmarkExists($row['bAddress'], $currentObjectUser->getId())) {
|
||||
$copy .= ' - <a href="'. createURL('bookmarks', $currentObjectUser->getUsername() .'?action=add&address='. urlencode($row['bAddress']) .'&title='. urlencode($row['bTitle'])). '&description='.urlencode($row['bDescription']). '&tags='.$tagsForCopy .'">'. T_('Copy') .'</a>';
|
||||
&& ($currentUser->getId() != $row['uId'])
|
||||
&& !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) {
|
||||
$copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&address='. urlencode($row['bAddress']) .'&title='. urlencode($row['bTitle'])). '&description='.urlencode($row['bDescription']). '&tags='.$tagsForCopy .'">'. T_('Copy') .'</a>';
|
||||
}
|
||||
|
||||
// Nofollow option
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
***************************************************************************/
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
$logged_on_userid = $userservice->getCurrentUserId();
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$this->includeTemplate($GLOBALS['top_include']);
|
||||
?>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Service creation: only useful services are created */
|
||||
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
require_once('sidebar.linkedtags.inc.php');
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Service creation: only useful services are created */
|
||||
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
require_once('sidebar.linkedtags.inc.php');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Service creation: only useful services are created */
|
||||
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
require_once('sidebar.linkedtags.inc.php');
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
if(!isset($user)) {
|
||||
$user = '';
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
// Menu moved to toolbar.inc.php
|
||||
|
||||
/*
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
if (utf8_strlen($userinfo['name']) > 0) {
|
||||
$name = $userinfo['name'];
|
||||
} else {
|
||||
$name = $userinfo['username'];
|
||||
}
|
||||
|
||||
|
||||
<h2><?php echo $name; ?></h2>
|
||||
<div id="profile">
|
||||
<ul>
|
||||
<li><a href="<?php echo $userservice->getProfileUrl($userid, $user); ?>"><?php echo T_('Profile'); ?></a> →</li>
|
||||
<li><a href="<?php echo createURL('alltags', $user); ?>"><?php echo T_('Tags'); ?></a> →</li>
|
||||
<li><a href="<?php echo createURL('watchlist', $user); ?>"><?php echo T_('Watchlist'); ?></a> →</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
*/
|
||||
?>
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
/* Manage input */
|
||||
$userid = isset($userid)?$userid:NULL;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Service creation: only useful services are created */
|
||||
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
|
||||
|
||||
if(!isset($user)) $user="";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
/* Service creation: only useful services are created */
|
||||
$searchhistoryservice =& ServiceFactory::getServiceInstance('SearchHistoryService');
|
||||
|
||||
$logged_on_userid = $userservice->getCurrentUserId();
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<?php
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
/* Service creation: only useful services are created */
|
||||
//No specific services
|
||||
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$currentUser = $userservice->getCurrentUser();
|
||||
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
||||
|
||||
if ($currentUsername == $user) {
|
||||
if ($currentUser->getUsername() == $user) {
|
||||
$tags = explode('+', $currenttag);
|
||||
$renametext = T_ngettext('Rename Tag', 'Rename Tags', count($tags));
|
||||
$renamelink = createURL('tagrename', $currenttag);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
/* Service creation: only useful services are created */
|
||||
//No specific services
|
||||
|
||||
$logged_on_userid = $userservice->getCurrentUserId();
|
||||
if ($logged_on_userid === false) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
/* Service creation: only useful services are created */
|
||||
//No specific services
|
||||
|
||||
$watching = $userservice->getWatchNames($userid);
|
||||
if ($watching) {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<?php
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$currentUser = $userservice->getCurrentUser();
|
||||
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
||||
/* Service creation: only useful services are created */
|
||||
//No specific services
|
||||
|
||||
if ($currentUsername != $user) {
|
||||
|
||||
if ($userservice->isLoggedOn()) {
|
||||
|
||||
if ($currentUser->getUsername() != $user) {
|
||||
$result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId());
|
||||
if ($result) {
|
||||
$linkText = T_('Remove from Watchlist');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
$this->includeTemplate($GLOBALS['top_include']);
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
$this->includeTemplate($GLOBALS['top_include']);
|
||||
$userservice = & ServiceFactory :: getServiceInstance('UserService');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
window.onload = function() {
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
<?php
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
if ($userservice->isLoggedOn()) {
|
||||
$cUser = $userservice->getCurrentUser();
|
||||
$cUserId = $userservice->getCurrentUserId();
|
||||
$cUsername = $cUser[$userservice->getFieldName('username')];
|
||||
$isAdmin = $userservice->isAdmin($cUser[$userservice->getFieldname('primary')]);
|
||||
$cUsername = $currentUser->getUsername();
|
||||
?>
|
||||
|
||||
<ul id="navigation">
|
||||
|
@ -15,7 +12,7 @@ if ($userservice->isLoggedOn()) {
|
|||
<li><a href="<?php echo createURL('bookmarks', $cUsername . '?action=add'); ?>"><?php echo T_('Add a Bookmark'); ?></a></li>
|
||||
<li class="access"><?php echo $cUsername?><a href="<?php echo ROOT ?>?action=logout">(<?php echo T_('Log Out'); ?>)</a></li>
|
||||
<li><a href="<?php echo createURL('about'); ?>"><?php echo T_('About'); ?></a></li>
|
||||
<?php if($isAdmin): ?>
|
||||
<?php if($currentUser->isAdmin()): ?>
|
||||
<li><a href="<?php echo createURL('admin', ''); ?>"><?php echo '['.T_('Admin').']'; ?></a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
@ -24,7 +21,6 @@ if ($userservice->isLoggedOn()) {
|
|||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
||||
<ul id="navigation">
|
||||
<li><a href="<?php echo createURL('populartags'); ?>"><?php echo T_('Popular Tags'); ?></a></li>
|
||||
<li><a href="<?php echo createURL('about'); ?>"><?php echo T_('About'); ?></a></li>
|
||||
|
|
|
@ -36,7 +36,6 @@ exit();
|
|||
/////////////////
|
||||
require_once('header.inc.php');
|
||||
$tagstatservice = & ServiceFactory :: getServiceInstance('TagStatService');
|
||||
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
|
||||
?>
|
||||
|
||||
<h1>Upgrade</h1>
|
||||
|
|
|
@ -23,8 +23,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
/* Managing current logged user */
|
||||
|
@ -33,7 +31,6 @@ $currentUser = $userservice->getCurrentObjectUser();
|
|||
/* Managing path info */
|
||||
list($url, $cat) = explode('/', $_SERVER['PATH_INFO']);
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
$pagetitle = T_('Users');
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
require_once('header.inc.php');
|
||||
|
||||
/* Service creation: only useful services are created */
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
//No specific services
|
||||
|
||||
/* Managing current logged user */
|
||||
$currentUser = $userservice->getCurrentObjectUser();
|
||||
|
@ -32,7 +32,6 @@ $currentUser = $userservice->getCurrentObjectUser();
|
|||
|
||||
|
||||
if ($userservice->isLoggedOn() && $user) {
|
||||
$tplVars = array();
|
||||
$pagetitle = '';
|
||||
|
||||
if (is_int($user)) {
|
||||
|
|
|
@ -22,8 +22,6 @@ require_once('header.inc.php');
|
|||
|
||||
/* Service creation: only useful services are created */
|
||||
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
||||
$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
|
||||
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
||||
$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
|
||||
|
||||
/* Managing all possible inputs */
|
||||
|
@ -36,7 +34,6 @@ $currentUser = $userservice->getCurrentObjectUser();
|
|||
/* Managing path info */
|
||||
@list($url, $user, $page) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
|
||||
|
||||
$tplVars = array();
|
||||
|
||||
if ($usecache) {
|
||||
// Generate hash for caching on
|
||||
|
|
Loading…
Reference in a new issue