Commit f1d0e263 authored by lphuberdeau's avatar lphuberdeau

[ENH] Converting userprefslib, memcachelib

parent 8bca95e6
......@@ -23,6 +23,9 @@
<service id="tiki.lib.filegal" class="FileGalLib">
<file>%kernel.root_dir%/lib/filegals/filegallib.php</file>
</service>
<service id="tiki.lib.memcache" class="Memcachelib">
<file>%kernel.root_dir%/lib/cache/memcachelib.php</file>
</service>
<service id="tiki.lib.multilingual" class="MultilingualLib">
<file>%kernel.root_dir%/lib/multilingual/multilinguallib.php</file>
</service>
......@@ -42,6 +45,9 @@
<service id="tiki.lib.user" class="UsersLib">
<file>%kernel.root_dir%/lib/userslib.php</file>
</service>
<service id="tiki.lib.userprefs" class="UserPrefsLib">
<file>%kernel.root_dir%/lib/userprefs/userprefslib.php</file>
</service>
<service id="tiki.lib.wiki" class="WikiLib">
<file>%kernel.root_dir%/lib/wiki/wikilib.php</file>
</service>
......
......@@ -28,7 +28,23 @@ class Memcachelib
*/
function Memcachelib($memcached_servers=FALSE, $memcached_options=FALSE)
{
global $tikidomainslash;
global $prefs, $tikidomainslash;
if ($memcached_servers === false && $memcached_options === false) {
if ( is_array($prefs['memcache_servers']) ) {
$memcached_servers = $prefs['memcache_servers'];
} else {
$memcached_servers = unserialize($prefs['memcache_servers']);
}
$memcached_options = array(
'enabled' => true,
'expiration' => (int) $prefs['memcache_expiration'],
'key_prefix' => $prefs['memcache_prefix'],
'compress' => $prefs['memcache_compress'],
);
}
$localphp = "db/{$tikidomainslash}local.php";
if (is_readable($localphp)) {
......@@ -223,19 +239,3 @@ class Memcachelib
}
}
global $prefs, $memcachelib;
if ( is_array($prefs['memcache_servers']) ) {
$servers = $prefs['memcache_servers'];
} else {
$servers = unserialize($prefs['memcache_servers']);
}
$memcachelib = new Memcachelib(
$servers, array(
'enabled' => true,
'expiration' => (int) $prefs['memcache_expiration'],
'key_prefix' => $prefs['memcache_prefix'],
'compress' => $prefs['memcache_compress'],
)
);
......@@ -68,12 +68,6 @@ class TikiLib extends TikiDb_Bridge
case 'smarty':
global $smarty;
return self::$libraries[$name] = $smarty;
case 'memcache':
global $memcachelib; include_once('lib/cache/memcachelib.php');
return self::$libraries[$name] = $memcachelib;
case 'userprefs':
global $userprefslib; include_once('lib/userprefs/userprefslib.php');
return self::$libraries[$name] = $userprefslib;
case 'logs':
global $logslib; include_once('lib/logs/logslib.php');
return self::$libraries[$name] = $logslib;
......
......@@ -124,7 +124,8 @@ class UserPrefsLib extends TikiLib
*/
function set_file_gallery_image($u, $filename, $size, $type, $data)
{
global $prefs, $tikilib;
global $prefs;
$tikilib = TikiLib::lib('tiki');
$filegallib = TikiLib::lib('filegal');
if (!$prefs["user_picture_gallery_id"]) {
return false;
......@@ -146,7 +147,8 @@ class UserPrefsLib extends TikiLib
*/
function remove_file_gallery_image($u)
{
global $prefs, $tikilib;
global $prefs;
$tikilib = TikiLib::lib('tiki');
$filegallib = TikiLib::lib('filegal');
if ($user_image_id = $tikilib->get_user_preference($u, 'user_fg_image_id')) {
$file_info = $filegallib->get_file_info($user_image_id, false, false);
......@@ -164,7 +166,7 @@ class UserPrefsLib extends TikiLib
*/
function get_user_picture_id($u)
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
return $tikilib->get_user_preference($u, 'user_fg_image_id');
}
......@@ -219,7 +221,8 @@ class UserPrefsLib extends TikiLib
*/
function get_user_clock_pref($user)
{
global $prefs; global $tikilib;
global $prefs;
$tikilib = TikiLib::lib('tiki');
$userclock = $tikilib->get_user_preference($user, 'display_12hr_clock');
$use_24hr_clock = true;
if ((isset($userclock) && $userclock == 'y') || (!isset($userclock) && $prefs['users_prefs_display_12hr_clock'] == 'y')) {
......@@ -228,4 +231,4 @@ class UserPrefsLib extends TikiLib
return $use_24hr_clock;
}
}
$userprefslib = new UserPrefsLib;
......@@ -388,7 +388,7 @@ class UsersLib extends TikiLib
// If preference login_multiple_forbidden is set, don't let user login if already logged in
if ($result == USER_VALID && $prefs['login_multiple_forbidden'] == 'y' && $user != 'admin' ) {
global $tikilib;
$tikilib = TikiLib::lib('tiki');
$tikilib->update_session();
if ( $tikilib->is_user_online($user) ) {
$result = USER_ALREADY_LOGGED;
......@@ -585,7 +585,7 @@ class UsersLib extends TikiLib
if ($userTikiPresent && $validafil) {
return array($this->sync_and_update_lastlogin($user, $pass), $user, USER_VALID);
} else {
global $smarty;
$smarty = TikiLib::lib('smarty');
// see if we can create a new account
if ($shib_create_tiki) {
......@@ -809,7 +809,8 @@ class UsersLib extends TikiLib
// validate the user through PAM
function validate_user_pam($user, $pass)
{
global $tikilib, $prefs;
global $prefs;
$tikilib = TikiLib::lib('tiki');
// just make sure we're supposed to be here
if ($prefs['auth_method'] != 'pam')
......@@ -830,7 +831,8 @@ class UsersLib extends TikiLib
function check_cas_authentication($user_cookie_site)
{
global $tikilib, $prefs, $webdav_access;
global $prefs, $webdav_access;
$tikilib = TikiLib::lib('tiki');
// Avoid CAS authentication check if the client is not able to handle HTTP redirects to another domain. This includes:
// - WebDAV requests
......@@ -909,7 +911,8 @@ class UsersLib extends TikiLib
// validate the user through CAS
function validate_user_cas(&$user, $checkOnly = false)
{
global $tikilib, $prefs, $base_url;
global $prefs, $base_url;
$tikilib = TikiLib::lib('tiki');
// just make sure we're supposed to be here
if (!$this->_init_cas_client()) {
......@@ -1522,7 +1525,8 @@ class UsersLib extends TikiLib
function create_user_ldap($user, $pass)
{
// todo: kein pear::auth mehr! alles in pead::ldap2 abbilden
global $tikilib, $prefs;
global $prefs;
$tikilib = TikiLib::lib('tiki');
$options = array();
$options['url'] = $prefs['auth_ldap_url'];
......@@ -6248,7 +6252,7 @@ class UsersLib extends TikiLib
private function generate_provisional_password()
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
require_once 'lib/phpsec/phpsec/phpsec.rand.php';
$site_hash = $tikilib->get_site_hash();
......@@ -6373,7 +6377,7 @@ class UsersLib extends TikiLib
$theme = '', $ufield = 0, $gfield = 0,$isexternal = 'n',
$expireAfter = 0, $emailPattern = '', $anniversary = '', $prorateInterval = '')
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
$group = trim($group);
if ( $this->group_exists($group) )
......@@ -6674,7 +6678,9 @@ class UsersLib extends TikiLib
function send_validation_email($name, $apass, $email, $again = '', $second = '',
$chosenGroup = '', $mailTemplate = '', $pass = '')
{
global $tikilib, $prefs, $smarty;
global $prefs;
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
// mail_machine kept for BC, use $validation_url
$machine = TikiLib::tikiUrl('tiki-login_validate.php');
......@@ -6874,7 +6880,7 @@ class UsersLib extends TikiLib
function confirm_email($user, $pass)
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
$query = 'select `provpass`, `login`, `unsuccessful_logins` from `users_users` where `login`=?';
$result = $this->query($query, array($user));
if (!($res = $result->fetchRow())) {
......@@ -6908,7 +6914,10 @@ class UsersLib extends TikiLib
function send_confirm_email($user,$tpl='confirm_user_email')
{
global $smarty, $prefs, $tikilib;
global $prefs;
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
include_once ('lib/webmail/tikimaillib.php');
$languageEmail = $this->get_user_preference($_REQUEST['username'], 'language', $prefs['site_language']);
$apass = $this->renew_user_password($user);
......@@ -7052,7 +7061,7 @@ class UsersLib extends TikiLib
$tikilib->set_user_preferences($user, $user_details['preferences']);
if (isset($avatarData)) {
global $userprefslib; include_once('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$userprefslib->set_user_avatar(
$user,
'u',
......@@ -7089,7 +7098,7 @@ class UsersLib extends TikiLib
function update_expired_groups()
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
$this->update_anniversary_expiry();
$query = 'SELECT uu.* FROM `users_usergroups` uu' .
' LEFT JOIN `users_groups` ug ON (uu.`groupName`= ug.`groupName`)' .
......@@ -7121,7 +7130,7 @@ class UsersLib extends TikiLib
function extend_membership($user, $group, $periods = 1, $date = null )
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
$this->update_expired_groups();
if ( ! $this->user_is_in_group($user, $group) ) {
......@@ -7321,7 +7330,8 @@ class UsersLib extends TikiLib
function clean_user($u, $force_check_realnames = false, $login_fallback = true)
{
global $tikilib, $prefs;
global $prefs;
$tikilib = TikiLib::lib('tiki');
if ( $prefs['user_show_realnames'] == 'y' || $force_check_realnames) {
// need to trim to prevent mustMatch failure
$realname = trim($tikilib->get_user_preference($u, 'realName', ''));
......@@ -7340,7 +7350,7 @@ class UsersLib extends TikiLib
private function categorize_user_tracker_item($user, $group)
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
$userid = $this->get_user_id($user);
$tracker = $this->get_usertracker($userid);
if ( $tracker && $tracker['usersTrackerId'] ) {
......@@ -7364,7 +7374,7 @@ class UsersLib extends TikiLib
private function uncategorize_user_tracker_item($user, $group)
{
global $tikilib;
$tikilib = TikiLib::lib('tiki');
$userid = $this->get_user_id($user);
$tracker = $this->get_usertracker($userid);
......
......@@ -7,7 +7,7 @@
require_once('lib/wizard/wizard.php');
include_once('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
/**
* Set up the Basic User Information
*/
......
......@@ -7,7 +7,7 @@
require_once('lib/wizard/wizard.php');
require_once('lib/notifications/notificationlib.php');
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
/**
* Set up the wysiwyg editor, including inline editing
......
......@@ -7,7 +7,7 @@
require_once('lib/wizard/wizard.php');
include_once('lib/userprefs/scrambleEmail.php');
include_once('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
/**
* Set up the wysiwyg editor, including inline editing
......
......@@ -7,7 +7,7 @@
require_once('lib/wizard/wizard.php');
require_once('lib/notifications/notificationlib.php');
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
/**
* Set up the wysiwyg editor, including inline editing
......
......@@ -11,9 +11,9 @@
$section = 'calendar';
require_once ('tiki-setup.php');
$categlib = TikiLib::lib('categ');
include_once ('lib/calendar/calendarlib.php');
$calendarlib = TikiLib::lib('calendar');
if ($prefs['feature_groupalert'] == 'y') {
include_once ('lib/groupalert/groupalertlib.php');
$groupalertlib = TikiLib::lib('groupalert');
}
$auto_query_args = array('calendarId', 'sort_mode', 'find', 'offset');
if (!isset($_REQUEST["calendarId"])) {
......@@ -208,7 +208,7 @@ $smarty->assign('personal', $info["personal"]);
$smarty->assign('startday', $info["startday"] < 0 ? 0 : $info['startday']);
$smarty->assign('endday', $info["endday"] < 0 ? 0 : $info['endday']);
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
$smarty->assign('defaulteventstatus', $info['defaulteventstatus']);
......
......@@ -9,17 +9,15 @@
// $Id$
require_once ('tiki-setup.php');
include_once ('lib/polls/polllib.php');
if (!isset($polllib)) {
$polllib = new PollLib;
}
$access->check_feature('feature_polls');
$access->check_permission('tiki_p_admin_polls');
$polllib = TikiLib::lib('poll');
$auto_query_args = array('pollId', 'sort_mode', 'offset', 'find');
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
if (!isset($_REQUEST["pollId"])) {
......
......@@ -66,7 +66,7 @@ $smarty->assign('blogId', $blogId);
$smarty->assign('postId', $postId);
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
if (isset($_REQUEST["publish_Hour"])) {
......
......@@ -422,7 +422,7 @@ foreach ($cell as $w=>$weeks) {
}
}
//Use 12- or 24-hour clock for times listed in day or week view based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$user_24hr_clock = $userprefslib->get_user_clock_pref($user);
$hrows = array();
......
......@@ -507,7 +507,7 @@ if ($calendar['customlocations'] == 'y') {
$smarty->assign('listlocs', $listlocs);
$smarty->assign('changeCal', isset($_REQUEST['changeCal']));
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
if ($calendar['customcategories'] == 'y') {
......
......@@ -43,7 +43,7 @@ if (!$skip) {
}
if ($prefs["user_store_file_gallery_picture"] == 'y' && isset($_REQUEST["avatar"])) {
require_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
if ($user_picture_id = $userprefslib->get_user_picture_id($_REQUEST["avatar"])) {
$_REQUEST['fileId'] = $user_picture_id;
} elseif (!empty($prefs['user_default_picture_id'])) {
......
......@@ -108,7 +108,7 @@ $expireDate = $tikilib->make_time(
);
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
$smarty->assign('arttitle', '');
......
......@@ -10,13 +10,13 @@
require_once ('tiki-setup.php');
require_once ('lib/tikilib.php'); # httpScheme()
$tikilib = TikiLib::lib('tiki');
$bannerlib = TikiLib::lib('banner');
$access->check_feature('feature_banners');
$access->check_permission('tiki_p_admin_banners');
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
if (isset($_REQUEST["bannerId"]) && $_REQUEST["bannerId"] > 0) {
......
......@@ -36,7 +36,7 @@ if (isset($_REQUEST["remove"])) {
$smarty->assign('data', '');
$smarty->assign('publishDate', $tikilib->now);
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
$smarty->assign('actual', '');
......
......@@ -6,10 +6,11 @@
// $Id$
require_once ('tiki-setup.php');
include_once ('lib/quizzes/quizlib.php');
$access->check_feature('feature_quizzes');
$quizlib = TikiLib::lib('quiz');
if (!isset($_REQUEST["quizId"])) {
$_REQUEST["quizId"] = 0;
}
......@@ -31,7 +32,7 @@ $auto_query_args = array(
$_REQUEST["questionsPerPage"] = 999;
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
......
......@@ -76,7 +76,7 @@ $publishDate = $tikilib->now;
$expireDate = $tikilib->make_time(0, 0, 0, $tikilib->date_format("%m"), $tikilib->date_format("%d"), $tikilib->date_format("%Y") + 1);
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
$smarty->assign('arttitle', '');
......
......@@ -161,8 +161,7 @@ if (isset($_REQUEST['intertiki']) and in_array($_REQUEST['intertiki'], array_key
$userlib->set_user_fields($user_details['info']);
$user = $requestedUser;
if ($prefs['feature_userPreferences'] == 'y' && $prefs['feature_intertiki_import_preferences'] == 'y') {
global $userprefslib;
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$userprefslib->set_user_avatar($user, 'u', '', $user_details['avatarName'], $user_details['avatarSize'], $user_details['avatarFileType'], $avatarData);
$userlib->set_user_preferences($user, $user_details['preferences']);
}
......
......@@ -156,7 +156,7 @@ if ($_REQUEST['view'] == 'list') {
$upcoming = $minicallib->minical_list_events_from_date($user, 0, $minical_upcoming, 'start_asc', '', $pdate_h);
$smarty->assign('upcoming', $upcoming['data']);
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
$hours = range(0, 23);
......
......@@ -10,8 +10,8 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
include_once ('lib/userprefs/userprefslib.php');
include_once ('lib/imagegals/imagegallib.php');
$userprefslib = TikiLib::lib('userprefs');
$imagegallib = TikiLib::lib('imagegal');
$access->check_feature('feature_userPreferences');
$access->check_user($user);
$auto_query_args = array('view_user');
......
......@@ -26,11 +26,11 @@ If you leave the data field blank, the default is to use all the questions from
You can also set the same option under the Generl Options section.
*/
require_once ('tiki-setup.php');
include_once ('lib/quizzes/quizlib.php');
$access->check_feature('feature_quizzes');
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$quizlib = TikiLib::lib('quiz');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
// quizId of 0 is used as a placeholder; There should NEVER be a row in the
......
......@@ -10,11 +10,11 @@
require_once ('tiki-setup.php');
include_once ('lib/commcenter/commlib.php');
include_once ('lib/articles/artlib.php');
$access->check_feature('feature_comm');
$access->check_permission('tiki_p_admin_received_articles');
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$artlib = TikiLib::lib('art');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
if (!isset($_REQUEST["receivedArticleId"])) {
......
......@@ -12,8 +12,8 @@ require 'tiki-setup.php';
$access->check_feature('feature_userPreferences');
global $userprefslib, $tikidomain;
include_once ('lib/userprefs/userprefslib.php');
global $tikidomain;
$userprefslib = TikiLib::lib('userprefs');
// application to display an image from the database with
// option to resize the image dynamically creating a thumbnail on the fly.
// you have to check if the user has permission to see this gallery
......
......@@ -11,7 +11,7 @@
require_once ('tiki-setup.php');
include_once ('lib/messu/messulib.php');
include_once ('lib/userprefs/scrambleEmail.php');
include_once ('lib/registration/registrationlib.php');
$registrationlib = TikiLib::lib('registration');
$trklib = TikiLib::lib('trk');
if (isset($_REQUEST['userId'])) {
$userwatch = $tikilib->get_user_login($_REQUEST['userId']);
......@@ -132,7 +132,7 @@ if ($prefs['feature_display_my_to_others'] == 'y') {
$smarty->assign_by_ref('user_items', $user_items);
}
if ($prefs['feature_articles'] == 'y') {
include_once ('lib/articles/artlib.php');
$artlib = TikiLib::lib('art');
$user_articles = $artlib->get_user_articles($userwatch, -1);
$smarty->assign_by_ref('user_articles', $user_articles);
}
......@@ -170,10 +170,7 @@ if ($prefs['feature_display_my_to_others'] == 'y') {
$mystuff[] = array( 'object' => $obj["object"], 'objectType' => $stuffType, 'comment' => $forum_comment );
}
}
global $logslib;
if (!is_object($logslib)) {
require_once("lib/logs/logslib.php");
}
$logslib = TikiLib::lib('logs');
$whoviewed = $logslib->get_who_viewed($mystuff, false);
$smarty->assign('whoviewed', $whoviewed);
}
......@@ -194,7 +191,7 @@ if ($prefs['user_tracker_infos']) {
ask_ticket('user-information');
// Get full user picture if it is set
if ($prefs["user_store_file_gallery_picture"] == 'y') {
require_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
if ($user_picture_id = $userprefslib->get_user_picture_id($userwatch)) {
$smarty->assign('user_picture_id', $user_picture_id);
}
......
......@@ -10,7 +10,6 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
//include_once ('lib/userprefs/userprefslib.php');
$auto_query_args = array('userId', 'view_user');
......
......@@ -10,9 +10,9 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
include_once ('lib/modules/modlib.php');
$modlib = TikiLib::lib('mod');
include_once ('lib/userprefs/scrambleEmail.php');
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
// User preferences screen
if ($prefs['feature_userPreferences'] != 'y' && $prefs['change_password'] != 'y' && $tiki_p_admin_users != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_userPreferences");
......
......@@ -628,7 +628,7 @@ for ($i = 0; $i <= 100; $i+= 10) {
$percs[] = $i;
}
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
$smarty->assign_by_ref('percs', $percs);
......
......@@ -15,9 +15,9 @@ $access->check_feature('feature_trackers');
$trklib = TikiLib::lib('trk');
if ($prefs['feature_groupalert'] == 'y') {
include_once ('lib/groupalert/groupalertlib.php');
$groupalertlib = TikiLib::lib('groupalert');
}
include_once ('lib/notifications/notificationlib.php');
$notificationlib = TikiLib::lib('notification');
if ($prefs['feature_categories'] == 'y') {
$categlib = TikiLib::lib('categ');
}
......@@ -340,7 +340,7 @@ if ($prefs['feature_user_watches'] == 'y' and $tiki_p_watch_trackers == 'y') {
if (isset($_REQUEST["save"])) {
if ($itemObject->canModify()) {
global $captchalib; include_once 'lib/captcha/captchalib.php';
$captchalib = TikiLib::lib('captcha');
if (empty($user) && $prefs['feature_antibot'] == 'y' && !$captchalib->validate()) {
$smarty->assign('msg', $captchalib->getErrors());
$smarty->assign('errortype', 'no_redirect_login');
......@@ -548,13 +548,12 @@ ask_ticket('view-trackers');
// Generate validation js
if ($prefs['feature_jquery'] == 'y' && $prefs['feature_jquery_validation'] == 'y') {
global $validatorslib;
include_once('lib/validatorslib.php');
$validatorslib = TikiLib::lib('validators');
$validationjs = $validatorslib->generateTrackerValidateJS($fields['data']);
$smarty->assign('validationjs', $validationjs);
}
//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$userprefslib = TikiLib::lib('userprefs');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));
// Display the template
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment