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);
?>
\ No newline at end of file
require_once('header.inc.php');\r
/* Service creation: only useful services are created */\r
-$userservice = & ServiceFactory :: getServiceInstance('UserService');\r
$bookmark2tagservice = & ServiceFactory :: getServiceInstance('Bookmark2Tagservice');\r
$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');\r
-$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
-
-/* Managing current logged user */
-$currentUser = $userservice->getCurrentObjectUser();\r
\r
// Header variables\r
$tplVars['subtitle'] = T_('Manage users');\r
/* 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 */
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']."\"},";
}
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', '');
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');
}
// Header variables
-$tplvars = array();
$pagetitle = T_('All Tags');
if (isset($user) && $user != '') {
die;
}
+/* Service creation: only useful services are created */
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+
/*
// Restrict to admins?
// 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');
// Force HTTP authentication first!
require_once('httpauth.inc.php');\r
require_once('../header.inc.php');\r
-\r
+
+/* Service creation: only useful services are created */\r
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');\r
-$userservice =& ServiceFactory::getServiceInstance('UserService');\r
\r
// Check to see if a tag was specified.\r
if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))\r
// Get the posts relevant to the passed-in variables.\r
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());\r
\r
-$currentuser = $userservice->getCurrentUser();\r
-$currentusername = $currentuser[$userservice->getFieldName('username')];\r
\r
// Set up the XML file and output all the posts.\r
header('Content-Type: text/html');\r
echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">';\r
echo '<!-- This is an automatically generated file. -->'."\r\n";\r
echo '<TITLE>Bookmarks</TITLE>'."\r\n";\r
-echo '<H1 LAST_MODIFIED="'. date('U') .'">Bookmarks for '. htmlspecialchars($currentusername) .''. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') ." from " . $sitename ."</H1>\r\n";\r
+echo '<H1 LAST_MODIFIED="'. date('U') .'">Bookmarks for '. htmlspecialchars($currentUser->getUsername()) .''. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') ." from " . $sitename ."</H1>\r\n";\r
echo '<DL><p>'."\r\n";\r
\r
\r
<?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');
-
- die(T_("Use of the API calls requires authentication."));
+ header('WWW-Authenticate: Basic realm="SemanticScuttle API"');
+ header('HTTP/1.0 401 Unauthorized');
+
+ 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');
+ /* 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);
+ }
- $login = $userservice->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
- if (!$login) {
- authenticate();
+ if (!isset($_SERVER['PHP_AUTH_USER'])) {
+ authenticate();
+ } else {
+ $login = $userservice->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
+ if (!$login) {
+ authenticate();
+ }
}
- }
}
?>
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']) != ''))
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']) != ''))
// 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']) == ''))
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']) != ''))
// 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) {
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.
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']) != ''))
// 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']) == ''))
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']) != ''))
// 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']) == ''))
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');
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());
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']) != ''))
/* 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 */
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();
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);
$template = 'error.500.tpl';
}
} elseif (POST_CANCEL) {
- $logged_on_user = $userservice->getCurrentUser();
header('Location: '. POST_REFERRER);
} else {
$bkm = $bookmarkservice->getBookmarkByHash($hash);
/* 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', '');
}
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();
}
}
} else if ($user && GET_POPUP == '') {
- $tplVars['sidebar_blocks'] = array('profile', 'watchstatus');
+ $tplVars['sidebar_blocks'] = array('watchstatus');
if (!$cat) {
$cat = NULL;
/* 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', '');
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');
header('Location: '. POST_REFERRER);
} else {
$tplVars['msg'] = T_('Bookmark saved');
- header('Location: '. createURL('bookmarks', $currentObjectUser->getUsername()));
+ header('Location: '. createURL('bookmarks', $currentUser->getUsername()));
}
}
}
if (POST_REFERRER != '') {
header('Location: '. POST_REFERRER);
} else {
- header('Location: '. createURL('bookmarks', $currentObjectUser->getUsername()));
+ header('Location: '. createURL('bookmarks', $currentUser->getUsername()));
}
exit();
} else {
die;
}
-$userservice = & ServiceFactory :: getServiceInstance('UserService');
-$currentUser = $userservice->getCurrentObjectUser();
?>
<html>
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;
?>
/* 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);
$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'] = '';
}
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
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();
global $depth, $status, $tplVars, $userservice;
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
- $userservice =& ServiceFactory::getServiceInstance('UserService');
if ($name == 'POST') {
while(list($attrTitle, $attrVal) = each($attrs)) {
/* Service creation: only useful services are created */
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
/* Managing all possible inputs */
// Other inputs
isset($_POST['status']) ? define('POST_STATUS', $_POST['status']): define('POST_STATUS', '');
-
-$tplVars = array();
$countImportedBookmarks = 0;
$tplVars['msg'] = '';
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 */
/* Managing all possible inputs */
// First input is $_FILES
-
-$tplVars = array();
$tplVars['msg'] = '';
if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['size'] > 0) {
/* 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 */
// Logout action
-$tplvars = array();
if (GET_ACTION == "logout") {
$userservice->logout();
$tplvars['msg'] = T_('You have now logged out');
/* Service creation: only useful services are created */
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
+// No specific services
/* Managing all possible inputs */
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;
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 != '') {
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']);
// 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;
}
}
}
// Header variables
-$tplvars = array();
$pagetitle = T_('Popular Tags');
if (isset($user) && $user != '') {
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', '');
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) {
exit();
}
-if ($userservice->isLoggedOn() && $user == $currentObjectUser->getUsername()) {
+if ($userservice->isLoggedOn() && $user == $currentUser->getUsername()) {
$title = T_('My Profile');
} else {
$title = T_('Profile') .': '. $user;
$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);
$userinfo = $userservice->getObjectUserByUsername($user);
}
-if (!$userservice->isLoggedOn() || $currentObjectUser->getId() != $userid) {
+if (!$userservice->isLoggedOn() || $currentUser->getId() != $userid) {
$templatename = 'profile.tpl.php';
} else {
//Token Init
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['antispamAnswer']) ? define('POST_ANTISPAMANSWER', $_POST['antispamAnswer']): define('POST_ANTISPAMANSWER', '');
-$tplVars = array();
-
if (POST_SUBMITTED != '') {
$posteduser = trim(utf8_strtolower(POST_USERNAME));
/* 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']);
$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;
}
}
} 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 */
$page= NULL;
}
- $tplvars = array();
$tplVars['loadjs'] = true;
// Pagination
/* 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', '');
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()) {
$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'] = '';
/* 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', '');
/* 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();
/* 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 */
/* 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', '');
/* 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', '');
$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', '');
/* 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 */
/* Managing path info */
list($url, $cat) = explode('/', $_SERVER['PATH_INFO']);
-$tplVars = array();
-
if (!$cat) {
header('Location: '. createURL('populartags'));
<?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']);
?>
<?php\r
-
-/* Service creation: only useful services are created */\r
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-
-$currentObjectUser = $userservice->getCurrentObjectUser();\r
\r
$this->includeTemplate($GLOBALS['top_include']);
echo '<a href="'.createURL('profile', $user->getUsername()).'">'.$user->getUsername().'</a>';\r
echo '</div>';\r
- if($user->getUsername() != $currentObjectUser->getUsername()) {\r
+ if($user->getUsername() != $currentUser->getUsername()) {\r
echo '<div class="meta">';\r
echo '<a href="'.createURL('admin','delete/'.$user->getUsername()).'" onclick="return confirm(\''.T_('Are you sure?').'\');">'.T_('Delete').'</a>';\r
echo '</div>';
<?php
-/* Service creation: only useful services are created */
-$userservice = & ServiceFactory :: getServiceInstance('UserService');
$this->includeTemplate($GLOBALS['top_include']);
<td></td>
</tr>
</table>
-</p>
<?php if (isset($referrer)): ?>
<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div>
<?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:"";
//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');
}
// 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
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();
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
$this->includeTemplate($GLOBALS['top_include']);
?>
<?php
+/* Service creation: only useful services are created */
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
require_once('sidebar.linkedtags.inc.php');
<?php
+/* Service creation: only useful services are created */
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+
require_once('sidebar.linkedtags.inc.php');
<?php
+/* Service creation: only useful services are created */
$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
require_once('sidebar.linkedtags.inc.php');
<?php
+/* Service creation: only useful services are created */
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+
if(!isset($user)) {
$user = '';
+++ /dev/null
-<?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>
-
-*/
-?>
<?php
+/* Service creation: only useful services are created */
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
/* Manage input */
$userid = isset($userid)?$userid:NULL;
<?php
+/* Service creation: only useful services are created */
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+
if(!isset($user)) $user="";
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Service creation: only useful services are created */
$searchhistoryservice =& ServiceFactory::getServiceInstance('SearchHistoryService');
$logged_on_userid = $userservice->getCurrentUserId();
<?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);
<?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) {
<?php
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Service creation: only useful services are created */
+//No specific services
$watching = $userservice->getWatchNames($userid);
if ($watching) {
<?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) {
$result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId());
if ($result) {
$linkText = T_('Remove from Watchlist');
<?php
$this->includeTemplate($GLOBALS['top_include']);
-$userservice = & ServiceFactory :: getServiceInstance('UserService');
+
?>
<script type="text/javascript">
window.onload = function() {
<?php
$this->includeTemplate($GLOBALS['top_include']);
-$userservice = & ServiceFactory :: getServiceInstance('UserService');
?>
<script type="text/javascript">
window.onload = function() {
<?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">
<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): ?>\r
+ <?php if($currentUser->isAdmin()): ?>\r
<li><a href="<?php echo createURL('admin', ''); ?>"><?php echo '['.T_('Admin').']'; ?></a></li>\r
<?php endif; ?>
<?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>
/////////////////
require_once('header.inc.php');
$tagstatservice = & ServiceFactory :: getServiceInstance('TagStatService');
-$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
?>
<h1>Upgrade</h1>
/* 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 */
/* Managing path info */
list($url, $cat) = explode('/', $_SERVER['PATH_INFO']);
-$tplVars = array();
$pagetitle = T_('Users');
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();
if ($userservice->isLoggedOn() && $user) {
- $tplVars = array();
$pagetitle = '';
if (is_int($user)) {
/* 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 */
/* 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