diff options
45 files changed, 616 insertions, 607 deletions
diff --git a/BitPermUser.php b/BitPermUser.php index 799bd14..613b661 100644 --- a/BitPermUser.php +++ b/BitPermUser.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/BitPermUser.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/BitPermUser.php,v 1.4 2005/08/01 18:42:01 squareing Exp $ * * Lib for user administration, groups and permissions * This lib uses pear so the constructor requieres @@ -12,7 +12,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: BitPermUser.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Id: BitPermUser.php,v 1.4 2005/08/01 18:42:01 squareing Exp $ * @package users */ @@ -25,7 +25,7 @@ require_once( USERS_PKG_PATH.'BitUser.php' ); * Class that holds all information for a given user * * @author spider <spider@steelsun.com> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * @package users * @subpackage BitPermUser */ @@ -394,8 +394,15 @@ class BitPermUser extends BitUser { } elseif( is_numeric($pGroupMixed) ) { $addGroups = array( $pGroupMixed ); } + $currentUserGroups = $this->getGroups($pUserId); foreach( $addGroups AS $groupId ) { - if ( !$this->isInGroup( $groupId ) ) { + $isInGroup = FALSE; + foreach ($currentUserGroups as $curGroup) { + if ($curGroup['group_id'] == $groupId) { + $isInGroup = TRUE; + } + } + if ( !$isInGroup ) { $query = "insert into `".BIT_DB_PREFIX."users_groups_map`(`user_id`,`group_id`) values(?,?)"; $result = $this->query($query, array( $pUserId, $groupId ), -1, -1); } diff --git a/BitUser.php b/BitUser.php index 99b7369..3997ac3 100644 --- a/BitUser.php +++ b/BitUser.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.7 2005/07/25 20:02:54 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.8 2005/08/01 18:42:01 squareing Exp $ * * Lib for user administration, groups and permissions * This lib uses pear so the constructor requieres @@ -12,7 +12,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: BitUser.php,v 1.7 2005/07/25 20:02:54 squareing Exp $ + * $Id: BitUser.php,v 1.8 2005/08/01 18:42:01 squareing Exp $ * @package users */ @@ -40,7 +40,7 @@ define("ACCOUNT_DISABLED", -6); * Class that holds all information for a given user * * @author spider <spider@steelsun.com> - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * @package users * @subpackage BitUser */ @@ -360,7 +360,7 @@ class BitUser extends LibertyAttachable { $this->mErrors['password'] = tra( 'Password must contain both letters and numbers' ); } else { // Generate a unique hash - $pParamHash['user_store']['hash'] = md5( strtolower( $pParamHash['login'] ).$pParamHash['password'].$pParamHash['email'] ); + $pParamHash['user_store']['hash'] = md5( strtolower( (!empty($pParamHash['login'])?$pParamHash['login']:'') ).$pParamHash['password'].$pParamHash['email'] ); $now = date("U"); if( !isset( $pParamHash['pass_due'] ) && $gBitSystem->getPreference('pass_due') ) { $pParamHash['user_store']['pass_due'] = $now + (60 * 60 * 24 * $gBitSystem->getPreference('pass_due') ); @@ -470,17 +470,17 @@ if ($gDebug) echo "Run : QUIT<br>"; * @return returnString */ function register( &$pParamHash ) { - global $notificationlib, $smarty, $gBitSystem; + global $notificationlib, $gBitSmarty, $gBitSystem; $ret = FALSE; if( $this->store( $pParamHash ) ) { require_once( KERNEL_PKG_PATH.'notification_lib.php' ); $ret = TRUE; $emails = $notificationlib->get_mail_events('user_registers','*'); foreach($emails as $email) { - $smarty->assign('mail_user',$pParamHash['login']); - $smarty->assign('mail_date',date("U")); - $smarty->assign('mail_site',$_SERVER["SERVER_NAME"]); - $mail_data = $smarty->fetch('bitpackage:users/new_user_notification.tpl'); + $gBitSmarty->assign('mail_user',$pParamHash['login']); + $gBitSmarty->assign('mail_date',date("U")); + $gBitSmarty->assign('mail_site',$_SERVER["SERVER_NAME"]); + $mail_data = $gBitSmarty->fetch('bitpackage:users/new_user_notification.tpl'); mail( $pParamHash['email'], tra('New user registration'),$mail_data,"From: ".$gBitSystem->getPreference('sender_email')."\r\nContent-type: text/plain;charset=utf-8\r\n"); } @@ -490,9 +490,9 @@ if ($gDebug) echo "Run : QUIT<br>"; } } $siteName = $gBitSystem->getPreference('siteTitle', $_SERVER['HTTP_HOST'] ); - $smarty->assign('siteName',$_SERVER["SERVER_NAME"]); - $smarty->assign('mail_site',$_SERVER["SERVER_NAME"]); - $smarty->assign('mail_user',$pParamHash['login']); + $gBitSmarty->assign('siteName',$_SERVER["SERVER_NAME"]); + $gBitSmarty->assign('mail_site',$_SERVER["SERVER_NAME"]); + $gBitSmarty->assign('mail_user',$pParamHash['login']); if( $gBitSystem->isFeatureActive( 'validateUsers' ) ) { // $apass = addslashes(substr(md5($gBitSystem->genPass()),0,25)); $apass = $pParamHash['user_store']['provpass']; @@ -501,18 +501,18 @@ if ($gDebug) echo "Run : QUIT<br>"; $machine = httpPrefix().$foo1; // Send the mail - $smarty->assign('msg',tra('You will receive an email with information to login for the first time into this site')); - $smarty->assign('mail_machine',$machine); - $smarty->assign('mail_apass',$apass); - $mail_data = $smarty->fetch('bitpackage:users/user_validation_mail.tpl'); + $gBitSmarty->assign('msg',tra('You will receive an email with information to login for the first time into this site')); + $gBitSmarty->assign('mail_machine',$machine); + $gBitSmarty->assign('mail_apass',$apass); + $mail_data = $gBitSmarty->fetch('bitpackage:users/user_validation_mail.tpl'); mail($pParamHash["email"], $siteName.' - '.tra('Your registration information'),$mail_data,"From: ".$gBitSystem->getPreference('sender_email')."\r\nContent-type: text/plain;charset=utf-8\r\n"); - $smarty->assign('showmsg','y'); + $gBitSmarty->assign('showmsg','y'); } if( $gBitSystem->isFeatureActive( 'send_welcome_email' ) ) { // Send the welcome mail - $smarty->assign( 'mailPassword',$pParamHash['password'] ); - $smarty->assign( 'mailEmail',$pParamHash['email'] ); - $mail_data = $smarty->fetch('bitpackage:users/welcome_mail.tpl'); + $gBitSmarty->assign( 'mailPassword',$pParamHash['password'] ); + $gBitSmarty->assign( 'mailEmail',$pParamHash['email'] ); + $mail_data = $gBitSmarty->fetch('bitpackage:users/welcome_mail.tpl'); mail($pParamHash["email"], tra( 'Welcome to' ).' '.$siteName,$mail_data,"From: ".$gBitSystem->getPreference('sender_email')."\r\nContent-type: text/plain;charset=utf-8\r\n"); } } diff --git a/admin/admin_login_inc.php b/admin/admin_login_inc.php index 8cd3907..916b52b 100644 --- a/admin/admin_login_inc.php +++ b/admin/admin_login_inc.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/admin_login_inc.php,v 1.2 2005/07/17 17:36:44 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/admin_login_inc.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -7,106 +7,106 @@ if (isset($_REQUEST["loginprefs"])) { if (isset($_REQUEST["eponymousGroups"]) && $_REQUEST["eponymousGroups"] == "on") { $gBitSystem->storePreference("eponymousGroups", 'y'); - $smarty->assign('eponymousGroups', 'y'); + $gBitSmarty->assign('eponymousGroups', 'y'); } else { $gBitSystem->storePreference("eponymousGroups", 'n'); - $smarty->assign('eponymousGroups', 'n'); + $gBitSmarty->assign('eponymousGroups', 'n'); } if (isset($_REQUEST["allowRegister"]) && $_REQUEST["allowRegister"] == "on") { $gBitSystem->storePreference("allowRegister", 'y'); - $smarty->assign('allowRegister', 'y'); + $gBitSmarty->assign('allowRegister', 'y'); } else { $gBitSystem->storePreference("allowRegister", 'n'); - $smarty->assign('allowRegister', 'n'); + $gBitSmarty->assign('allowRegister', 'n'); } if (isset($_REQUEST["send_welcome_email"]) && $_REQUEST["send_welcome_email"] == "on") { $gBitSystem->storePreference("send_welcome_email", 'y'); - $smarty->assign('send_welcome_email', 'y'); + $gBitSmarty->assign('send_welcome_email', 'y'); } else { $gBitSystem->storePreference("send_welcome_email", 'n'); - $smarty->assign('send_welcome_email', 'n'); + $gBitSmarty->assign('send_welcome_email', 'n'); } if (isset($_REQUEST["webserverauth"]) && $_REQUEST["webserverauth"] == "on") { $gBitSystem->storePreference("webserverauth", 'y'); - $smarty->assign('webserverauth', 'y'); + $gBitSmarty->assign('webserverauth', 'y'); } else { $gBitSystem->storePreference("webserverauth", 'n'); - $smarty->assign('webserverauth', 'n'); + $gBitSmarty->assign('webserverauth', 'n'); } if (isset($_REQUEST["useRegisterPasscode"]) && $_REQUEST["useRegisterPasscode"] == "on") { $gBitSystem->storePreference("useRegisterPasscode", 'y'); - $smarty->assign('useRegisterPasscode', 'y'); + $gBitSmarty->assign('useRegisterPasscode', 'y'); } else { $gBitSystem->storePreference("useRegisterPasscode", 'n'); - $smarty->assign('useRegisterPasscode', 'n'); + $gBitSmarty->assign('useRegisterPasscode', 'n'); } $gBitSystem->storePreference("registerPasscode", $_REQUEST["registerPasscode"]); - $smarty->assign('registerPasscode', $_REQUEST["registerPasscode"]); + $gBitSmarty->assign('registerPasscode', $_REQUEST["registerPasscode"]); $gBitSystem->storePreference("min_pass_length", $_REQUEST["min_pass_length"]); - $smarty->assign('min_pass_length', $_REQUEST["min_pass_length"]); + $gBitSmarty->assign('min_pass_length', $_REQUEST["min_pass_length"]); if (isset($_REQUEST["user_password_generator"]) && $_REQUEST["user_password_generator"] == "on") { $gBitSystem->storePreference("user_password_generator", 'y'); - $smarty->assign('user_password_generator', 'y'); + $gBitSmarty->assign('user_password_generator', 'y'); } else { $gBitSystem->storePreference("user_password_generator", 'n'); - $smarty->assign('user_password_generator', 'n'); + $gBitSmarty->assign('user_password_generator', 'n'); } if (isset($_REQUEST["validateUsers"]) && $_REQUEST["validateUsers"] == "on") { $gBitSystem->storePreference("validateUsers", 'y'); - $smarty->assign('validateUsers', 'y'); + $gBitSmarty->assign('validateUsers', 'y'); } else { $gBitSystem->storePreference("validateUsers", 'n'); - $smarty->assign('validateUsers', 'n'); + $gBitSmarty->assign('validateUsers', 'n'); } if (isset($_REQUEST["validateEmail"]) && $_REQUEST["validateEmail"] == "on" && $gBitSystem->hasValidSenderEmail() ) { $gBitSystem->storePreference("validateEmail", 'y'); - $smarty->assign('validateEmail', 'y'); + $gBitSmarty->assign('validateEmail', 'y'); } else { $gBitSystem->storePreference("validateEmail", 'n'); - $smarty->assign('validateEmail', 'n'); + $gBitSmarty->assign('validateEmail', 'n'); } if (isset($_REQUEST["rnd_num_reg"]) && $_REQUEST["rnd_num_reg"] == "on") { $gBitSystem->storePreference("rnd_num_reg", 'y'); - $smarty->assign('rnd_num_reg', 'y'); + $gBitSmarty->assign('rnd_num_reg', 'y'); } else { $gBitSystem->storePreference("rnd_num_reg", 'n'); - $smarty->assign('rnd_num_reg', 'n'); + $gBitSmarty->assign('rnd_num_reg', 'n'); } if (isset($_REQUEST["pass_chr_num"]) && $_REQUEST["pass_chr_num"] == "on") { $gBitSystem->storePreference("pass_chr_num", 'y'); - $smarty->assign('pass_chr_num', 'y'); + $gBitSmarty->assign('pass_chr_num', 'y'); } else { $gBitSystem->storePreference("pass_chr_num", 'n'); - $smarty->assign('pass_chr_num', 'n'); + $gBitSmarty->assign('pass_chr_num', 'n'); } if (isset($_REQUEST["feature_clear_passwords"]) && $_REQUEST["feature_clear_passwords"] == "on") { $gBitSystem->storePreference("feature_clear_passwords", 'y'); - $smarty->assign('feature_clear_passwords', 'y'); + $gBitSmarty->assign('feature_clear_passwords', 'y'); } else { $gBitSystem->storePreference("feature_clear_passwords", 'n'); - $smarty->assign('feature_clear_passwords', 'n'); + $gBitSmarty->assign('feature_clear_passwords', 'n'); } if (isset($_REQUEST["forgotPass"]) && $_REQUEST["forgotPass"] == "on") { $gBitSystem->storePreference("forgotPass", 'y'); - $smarty->assign('forgotPass', 'y'); + $gBitSmarty->assign('forgotPass', 'y'); } else { $gBitSystem->storePreference("forgotPass", 'n'); - $smarty->assign('forgotPass', 'n'); + $gBitSmarty->assign('forgotPass', 'n'); } if (isset($_REQUEST["rememberme"]) && $_REQUEST["rememberme"] == "on") { $gBitSystem->storePreference("rememberme", 'y'); - $smarty->assign('rememberme', 'y'); + $gBitSmarty->assign('rememberme', 'y'); } else { $gBitSystem->storePreference("rememberme", 'n'); - $smarty->assign('rememberme', 'n'); + $gBitSmarty->assign('rememberme', 'n'); } $gBitSystem->storePreference("pass_due", $_REQUEST["pass_due"]); - $smarty->assign('pass_due', $_REQUEST["pass_due"]); + $gBitSmarty->assign('pass_due', $_REQUEST["pass_due"]); $gBitSystem->storePreference('remembertime', $_REQUEST['remembertime']); - $smarty->assign('remembertime', $_REQUEST['remembertime']); + $gBitSmarty->assign('remembertime', $_REQUEST['remembertime']); $v = isset($_REQUEST['cookie_domain']) ? $_REQUEST['cookie_domain'] : $_SERVER['SERVER_NAME']; $gBitSystem->storePreference('cookie_domain', $v); - $smarty->assign('cookie_domain', $v); + $gBitSmarty->assign('cookie_domain', $v); if ( isset($_REQUEST['cookie_path']) ) { $v = $_REQUEST['cookie_path']; $v = ( preg_match( "/^\//", $v ) ) ? $v : "/" . $v; @@ -114,173 +114,173 @@ if (isset($_REQUEST["loginprefs"])) { $v = BIT_ROOT_URL; } $gBitSystem->storePreference('cookie_path', $v); - $smarty->assign('cookie_path', $v); + $gBitSmarty->assign('cookie_path', $v); if (isset($_REQUEST["auth_method"])) { $gBitSystem->storePreference('auth_method', $_REQUEST['auth_method']); - $smarty->assign('auth_method', $_REQUEST['auth_method']); + $gBitSmarty->assign('auth_method', $_REQUEST['auth_method']); } $b = (isset($_REQUEST['feature_ticketlib']) && $_REQUEST['feature_ticketlib'] == 'on') ? 'y' : 'n'; $gBitSystem->storePreference('feature_ticketlib', $b); - $smarty->assign('feature_ticketlib', $b); + $gBitSmarty->assign('feature_ticketlib', $b); } if (isset($_REQUEST["httpprefs"])) { $b = (isset($_REQUEST['https_login']) && $_REQUEST['https_login'] == 'on') ? 'y' : 'n'; $gBitSystem->storePreference('https_login', $b); - $smarty->assign('https_login', $b); + $gBitSmarty->assign('https_login', $b); $b = (isset($_REQUEST['https_login_required']) && $_REQUEST['https_login_required'] == 'on') ? 'y' : 'n'; $gBitSystem->storePreference('https_login_required', $b); - $smarty->assign('https_login_required', $b); + $gBitSmarty->assign('https_login_required', $b); /* # not implemented $b = isset($_REQUEST['http_basic_auth']) && $_REQUEST['http_basic_auth'] == 'on'; $gBitSystem->storePreference('http_basic_auth', $b); - $smarty->assign('http_basic_auth', $b); + $gBitSmarty->assign('http_basic_auth', $b); */ $v = isset($_REQUEST['http_domain']) ? $_REQUEST['http_domain'] : ''; $gBitSystem->storePreference('http_domain', $v); - $smarty->assign('http_domain', $v); + $gBitSmarty->assign('http_domain', $v); $v = isset($_REQUEST['http_port']) ? $_REQUEST['http_port'] : 80; $gBitSystem->storePreference('http_port', $v); - $smarty->assign('http_port', $v); + $gBitSmarty->assign('http_port', $v); $v = isset($_REQUEST['http_prefix']) ? $_REQUEST['http_prefix'] : BIT_ROOT_URL; $gBitSystem->storePreference('http_prefix', $v); - $smarty->assign('http_prefix', $v); + $gBitSmarty->assign('http_prefix', $v); $v = isset($_REQUEST['https_domain']) ? $_REQUEST['https_domain'] : ''; $gBitSystem->storePreference('https_domain', $v); - $smarty->assign('https_domain', $v); + $gBitSmarty->assign('https_domain', $v); $v = isset($_REQUEST['https_port']) ? $_REQUEST['https_port'] : 443; $gBitSystem->storePreference('https_port', $v); - $smarty->assign('https_port', $v); + $gBitSmarty->assign('https_port', $v); $v = isset($_REQUEST['https_prefix']) ? $_REQUEST['https_prefix'] : BIT_ROOT_URL; $gBitSystem->storePreference('https_prefix', $v); - $smarty->assign('https_prefix', $v); + $gBitSmarty->assign('https_prefix', $v); } if (isset($_REQUEST["auth_pear"])) { if (isset($_REQUEST["auth_create_gBitDbUser"]) && $_REQUEST["auth_create_gBitDbUser"] == "on") { $gBitSystem->storePreference("auth_create_gBitDbUser", 'y'); - $smarty->assign("auth_create_gBitDbUser", 'y'); + $gBitSmarty->assign("auth_create_gBitDbUser", 'y'); } else { $gBitSystem->storePreference("auth_create_gBitDbUser", 'n'); - $smarty->assign("auth_create_gBitDbUser", 'n'); + $gBitSmarty->assign("auth_create_gBitDbUser", 'n'); } if (isset($_REQUEST["auth_create_user_auth"]) && $_REQUEST["auth_create_user_auth"] == "on") { $gBitSystem->storePreference("auth_create_user_auth", 'y'); - $smarty->assign("auth_create_user_auth", 'y'); + $gBitSmarty->assign("auth_create_user_auth", 'y'); } else { $gBitSystem->storePreference("auth_create_user_auth", 'n'); - $smarty->assign("auth_create_user_auth", 'n'); + $gBitSmarty->assign("auth_create_user_auth", 'n'); } if (isset($_REQUEST["auth_skip_admin"]) && $_REQUEST["auth_skip_admin"] == "on") { $gBitSystem->storePreference("auth_skip_admin", 'y'); - $smarty->assign("auth_skip_admin", 'y'); + $gBitSmarty->assign("auth_skip_admin", 'y'); } else { $gBitSystem->storePreference("auth_skip_admin", 'n'); - $smarty->assign("auth_skip_admin", 'n'); + $gBitSmarty->assign("auth_skip_admin", 'n'); } if (isset($_REQUEST["auth_ldap_host"])) { $gBitSystem->storePreference("auth_ldap_host", $_REQUEST["auth_ldap_host"]); - $smarty->assign('auth_ldap_host', $_REQUEST["auth_ldap_host"]); + $gBitSmarty->assign('auth_ldap_host', $_REQUEST["auth_ldap_host"]); } if (isset($_REQUEST["auth_ldap_port"])) { $gBitSystem->storePreference("auth_ldap_port", $_REQUEST["auth_ldap_port"]); - $smarty->assign('auth_ldap_port', $_REQUEST["auth_ldap_port"]); + $gBitSmarty->assign('auth_ldap_port', $_REQUEST["auth_ldap_port"]); } if (isset($_REQUEST["auth_ldap_scope"])) { $gBitSystem->storePreference("auth_ldap_scope", $_REQUEST["auth_ldap_scope"]); - $smarty->assign('auth_ldap_scope', $_REQUEST["auth_ldap_scope"]); + $gBitSmarty->assign('auth_ldap_scope', $_REQUEST["auth_ldap_scope"]); } if (isset($_REQUEST["auth_ldap_basedn"])) { $gBitSystem->storePreference("auth_ldap_basedn", $_REQUEST["auth_ldap_basedn"]); - $smarty->assign('auth_ldap_basedn', $_REQUEST["auth_ldap_basedn"]); + $gBitSmarty->assign('auth_ldap_basedn', $_REQUEST["auth_ldap_basedn"]); } if (isset($_REQUEST["auth_ldap_userdn"])) { $gBitSystem->storePreference("auth_ldap_userdn", $_REQUEST["auth_ldap_userdn"]); - $smarty->assign('auth_ldap_userdn', $_REQUEST["auth_ldap_userdn"]); + $gBitSmarty->assign('auth_ldap_userdn', $_REQUEST["auth_ldap_userdn"]); } if (isset($_REQUEST["auth_ldap_userattr"])) { $gBitSystem->storePreference("auth_ldap_userattr", $_REQUEST["auth_ldap_userattr"]); - $smarty->assign('auth_ldap_userattr', $_REQUEST["auth_ldap_userattr"]); + $gBitSmarty->assign('auth_ldap_userattr', $_REQUEST["auth_ldap_userattr"]); } if (isset($_REQUEST["auth_ldap_useroc"])) { $gBitSystem->storePreference("auth_ldap_useroc", $_REQUEST["auth_ldap_useroc"]); - $smarty->assign('auth_ldap_useroc', $_REQUEST["auth_ldap_useroc"]); + $gBitSmarty->assign('auth_ldap_useroc', $_REQUEST["auth_ldap_useroc"]); } if (isset($_REQUEST["auth_ldap_groupdn"])) { $gBitSystem->storePreference("auth_ldap_groupdn", $_REQUEST["auth_ldap_groupdn"]); - $smarty->assign('auth_ldap_groupdn', $_REQUEST["auth_ldap_groupdn"]); + $gBitSmarty->assign('auth_ldap_groupdn', $_REQUEST["auth_ldap_groupdn"]); } if (isset($_REQUEST["auth_ldap_groupattr"])) { $gBitSystem->storePreference("auth_ldap_groupattr", $_REQUEST["auth_ldap_groupattr"]); - $smarty->assign('auth_ldap_groupattr', $_REQUEST["auth_ldap_groupattr"]); + $gBitSmarty->assign('auth_ldap_groupattr', $_REQUEST["auth_ldap_groupattr"]); } if (isset($_REQUEST["auth_ldap_groupoc"])) { $gBitSystem->storePreference("auth_ldap_groupoc", $_REQUEST["auth_ldap_groupoc"]); - $smarty->assign('auth_ldap_groupoc', $_REQUEST["auth_ldap_groupoc"]); + $gBitSmarty->assign('auth_ldap_groupoc', $_REQUEST["auth_ldap_groupoc"]); } if (isset($_REQUEST["auth_ldap_memberattr"])) { $gBitSystem->storePreference("auth_ldap_memberattr", $_REQUEST["auth_ldap_memberattr"]); - $smarty->assign('auth_ldap_ldap_memberattr', $_REQUEST["auth_ldap_memberattr"]); + $gBitSmarty->assign('auth_ldap_ldap_memberattr', $_REQUEST["auth_ldap_memberattr"]); } if (isset($_REQUEST["auth_ldap_memberisdn"]) && $_REQUEST["auth_ldap_memberisdn"] == "on") { $gBitSystem->storePreference("auth_ldap_memberisdn", 'y'); - $smarty->assign("auth_ldap_memberisdn", 'y'); + $gBitSmarty->assign("auth_ldap_memberisdn", 'y'); } else { $gBitSystem->storePreference("auth_ldap_memberisdn", 'n'); - $smarty->assign("auth_ldap_memberisdn", 'n'); + $gBitSmarty->assign("auth_ldap_memberisdn", 'n'); } if (isset($_REQUEST["auth_ldap_adminuser"])) { $gBitSystem->storePreference("auth_ldap_adminuser", $_REQUEST["auth_ldap_adminuser"]); - $smarty->assign('auth_ldap_adminuser', $_REQUEST["auth_ldap_adminuser"]); + $gBitSmarty->assign('auth_ldap_adminuser', $_REQUEST["auth_ldap_adminuser"]); } if (isset($_REQUEST["auth_ldap_adminpass"])) { $gBitSystem->storePreference("auth_ldap_adminpass", $_REQUEST["auth_ldap_adminpass"]); - $smarty->assign('auth_ldap_adminpass', $_REQUEST["auth_ldap_adminpass"]); + $gBitSmarty->assign('auth_ldap_adminpass', $_REQUEST["auth_ldap_adminpass"]); } } -$smarty->assign("change_theme", $gBitSystem->getPreference("change_theme", "n")); -$smarty->assign("change_language", $gBitSystem->getPreference("change_language", "n")); -$smarty->assign("eponymousGroups", $gBitSystem->getPreference("eponymousGroups", 'n')); -$smarty->assign("allowRegister", $gBitSystem->getPreference("allowRegister", 'n')); -$smarty->assign("webserverauth", $gBitSystem->getPreference("webserverauth", 'n')); -$smarty->assign("useRegisterPasscode", $gBitSystem->getPreference("useRegisterPasscode", 'n')); -$smarty->assign("registerPasscode", $gBitSystem->getPreference("registerPasscode", '')); -$smarty->assign("min_pass_length", $gBitSystem->getPreference("min_pass_length", '1')); -$smarty->assign("pass_due", $gBitSystem->getPreference("pass_due", '999')); -$smarty->assign("validateUsers", $gBitSystem->getPreference("validateUsers", 'n')); -$smarty->assign("validateEmail", $gBitSystem->getPreference("validateEmail", 'n')); -$smarty->assign("rnd_num_reg", $gBitSystem->getPreference("rnd_num_reg", 'n')); -$smarty->assign("pass_chr_num", $gBitSystem->getPreference("pass_chr_num", 'n')); -$smarty->assign("feature_clear_passwords", $gBitSystem->getPreference("feature_clear_passwords", 'n')); -$smarty->assign("forgotPass", $gBitSystem->getPreference("forgotPass", 'n')); -$smarty->assign("https_login", $gBitSystem->getPreference("https_login", 'n')); -$smarty->assign("https_login_required", $gBitSystem->getPreference("https_login_required", 'n')); -$smarty->assign("http_domain", $gBitSystem->getPreference("http_domain", '')); -$smarty->assign("http_port", $gBitSystem->getPreference("http_port", '80')); -$smarty->assign("http_prefix", $gBitSystem->getPreference("http_prefix", BIT_ROOT_URL)); -$smarty->assign("https_domain", $gBitSystem->getPreference("https_domain", '')); -$smarty->assign("https_port", $gBitSystem->getPreference("https_port", '443')); -$smarty->assign("https_prefix", $gBitSystem->getPreference("https_prefix", BIT_ROOT_URL)); -$smarty->assign("remembertime", $gBitSystem->getPreference("remembertime", 2592000)); -$smarty->assign("cookie_domain", $gBitSystem->getPreference("cookie_domain", $_SERVER['SERVER_NAME'])); -$smarty->assign("cookie_path", $gBitSystem->getPreference("cookie_path", BIT_ROOT_URL)); -$smarty->assign("auth_method", $gBitSystem->getPreference("auth_method", 'tiki')); -$smarty->assign("feature_ticketlib", $gBitSystem->getPreference("feature_ticketlib", 'n')); -$smarty->assign("auth_create_gBitDbUser", $gBitSystem->getPreference("auth_create_gBitDbUser", 'n')); -$smarty->assign("auth_create_user_auth", $gBitSystem->getPreference("auth_create_user_auth", 'n')); -$smarty->assign("auth_skip_admin", $gBitSystem->getPreference("auth_skip_admin", 'y')); -$smarty->assign("auth_ldap_host", $gBitSystem->getPreference("auth_ldap_host", 'localhost')); -$smarty->assign("auth_ldap_port", $gBitSystem->getPreference("auth_ldap_port", '389')); -$smarty->assign("auth_ldap_scope", $gBitSystem->getPreference("auth_ldap_scope", 'sub')); -$smarty->assign("auth_ldap_basedn", $gBitSystem->getPreference("auth_ldap_basedn", '')); -$smarty->assign("auth_ldap_userdn", $gBitSystem->getPreference("auth_ldap_userdn", '')); -$smarty->assign("auth_ldap_userattr", $gBitSystem->getPreference("auth_ldap_userattr", 'uid')); -$smarty->assign("auth_ldap_useroc", $gBitSystem->getPreference("auth_ldap_useroc", 'inetOrgPerson')); -$smarty->assign("auth_ldap_groupdn", $gBitSystem->getPreference("auth_ldap_groupdn", '')); -$smarty->assign("auth_ldap_groupattr", $gBitSystem->getPreference("auth_ldap_groupattr", 'cn')); -$smarty->assign("auth_ldap_groupoc", $gBitSystem->getPreference("auth_ldap_groupoc", 'groupOfUniqueNames')); -$smarty->assign("auth_ldap_ldap_memberattr", $gBitSystem->getPreference("auth_ldap_ldap_memberattr", 'uniqueMember')); -$smarty->assign("auth_ldap_memberisdn", $gBitSystem->getPreference("auth_ldap_memberisdn", 'y')); -$smarty->assign("auth_ldap_adminuser", $gBitSystem->getPreference("auth_ldap_adminuser", '')); -$smarty->assign("auth_ldap_adminpass", $gBitSystem->getPreference("auth_ldap_adminpass", '')); +$gBitSmarty->assign("change_theme", $gBitSystem->getPreference("change_theme", "n")); +$gBitSmarty->assign("change_language", $gBitSystem->getPreference("change_language", "n")); +$gBitSmarty->assign("eponymousGroups", $gBitSystem->getPreference("eponymousGroups", 'n')); +$gBitSmarty->assign("allowRegister", $gBitSystem->getPreference("allowRegister", 'n')); +$gBitSmarty->assign("webserverauth", $gBitSystem->getPreference("webserverauth", 'n')); +$gBitSmarty->assign("useRegisterPasscode", $gBitSystem->getPreference("useRegisterPasscode", 'n')); +$gBitSmarty->assign("registerPasscode", $gBitSystem->getPreference("registerPasscode", '')); +$gBitSmarty->assign("min_pass_length", $gBitSystem->getPreference("min_pass_length", '1')); +$gBitSmarty->assign("pass_due", $gBitSystem->getPreference("pass_due", '999')); +$gBitSmarty->assign("validateUsers", $gBitSystem->getPreference("validateUsers", 'n')); +$gBitSmarty->assign("validateEmail", $gBitSystem->getPreference("validateEmail", 'n')); +$gBitSmarty->assign("rnd_num_reg", $gBitSystem->getPreference("rnd_num_reg", 'n')); +$gBitSmarty->assign("pass_chr_num", $gBitSystem->getPreference("pass_chr_num", 'n')); +$gBitSmarty->assign("feature_clear_passwords", $gBitSystem->getPreference("feature_clear_passwords", 'n')); +$gBitSmarty->assign("forgotPass", $gBitSystem->getPreference("forgotPass", 'n')); +$gBitSmarty->assign("https_login", $gBitSystem->getPreference("https_login", 'n')); +$gBitSmarty->assign("https_login_required", $gBitSystem->getPreference("https_login_required", 'n')); +$gBitSmarty->assign("http_domain", $gBitSystem->getPreference("http_domain", '')); +$gBitSmarty->assign("http_port", $gBitSystem->getPreference("http_port", '80')); +$gBitSmarty->assign("http_prefix", $gBitSystem->getPreference("http_prefix", BIT_ROOT_URL)); +$gBitSmarty->assign("https_domain", $gBitSystem->getPreference("https_domain", '')); +$gBitSmarty->assign("https_port", $gBitSystem->getPreference("https_port", '443')); +$gBitSmarty->assign("https_prefix", $gBitSystem->getPreference("https_prefix", BIT_ROOT_URL)); +$gBitSmarty->assign("remembertime", $gBitSystem->getPreference("remembertime", 2592000)); +$gBitSmarty->assign("cookie_domain", $gBitSystem->getPreference("cookie_domain", $_SERVER['SERVER_NAME'])); +$gBitSmarty->assign("cookie_path", $gBitSystem->getPreference("cookie_path", BIT_ROOT_URL)); +$gBitSmarty->assign("auth_method", $gBitSystem->getPreference("auth_method", 'tiki')); +$gBitSmarty->assign("feature_ticketlib", $gBitSystem->getPreference("feature_ticketlib", 'n')); +$gBitSmarty->assign("auth_create_gBitDbUser", $gBitSystem->getPreference("auth_create_gBitDbUser", 'n')); +$gBitSmarty->assign("auth_create_user_auth", $gBitSystem->getPreference("auth_create_user_auth", 'n')); +$gBitSmarty->assign("auth_skip_admin", $gBitSystem->getPreference("auth_skip_admin", 'y')); +$gBitSmarty->assign("auth_ldap_host", $gBitSystem->getPreference("auth_ldap_host", 'localhost')); +$gBitSmarty->assign("auth_ldap_port", $gBitSystem->getPreference("auth_ldap_port", '389')); +$gBitSmarty->assign("auth_ldap_scope", $gBitSystem->getPreference("auth_ldap_scope", 'sub')); +$gBitSmarty->assign("auth_ldap_basedn", $gBitSystem->getPreference("auth_ldap_basedn", '')); +$gBitSmarty->assign("auth_ldap_userdn", $gBitSystem->getPreference("auth_ldap_userdn", '')); +$gBitSmarty->assign("auth_ldap_userattr", $gBitSystem->getPreference("auth_ldap_userattr", 'uid')); +$gBitSmarty->assign("auth_ldap_useroc", $gBitSystem->getPreference("auth_ldap_useroc", 'inetOrgPerson')); +$gBitSmarty->assign("auth_ldap_groupdn", $gBitSystem->getPreference("auth_ldap_groupdn", '')); +$gBitSmarty->assign("auth_ldap_groupattr", $gBitSystem->getPreference("auth_ldap_groupattr", 'cn')); +$gBitSmarty->assign("auth_ldap_groupoc", $gBitSystem->getPreference("auth_ldap_groupoc", 'groupOfUniqueNames')); +$gBitSmarty->assign("auth_ldap_ldap_memberattr", $gBitSystem->getPreference("auth_ldap_ldap_memberattr", 'uniqueMember')); +$gBitSmarty->assign("auth_ldap_memberisdn", $gBitSystem->getPreference("auth_ldap_memberisdn", 'y')); +$gBitSmarty->assign("auth_ldap_adminuser", $gBitSystem->getPreference("auth_ldap_adminuser", '')); +$gBitSmarty->assign("auth_ldap_adminpass", $gBitSystem->getPreference("auth_ldap_adminpass", '')); ?> diff --git a/admin/admin_userfiles_inc.php b/admin/admin_userfiles_inc.php index 8247468..99250f7 100644 --- a/admin/admin_userfiles_inc.php +++ b/admin/admin_userfiles_inc.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/admin_userfiles_inc.php,v 1.1 2005/06/19 05:12:23 bitweaver Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/admin_userfiles_inc.php,v 1.2 2005/08/01 18:42:02 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -8,9 +8,9 @@ if (isset($_REQUEST["userfilesprefs"])) { $gBitSystem->storePreference("uf_use_db", $_REQUEST["uf_use_db"]); $gBitSystem->storePreference("uf_use_dir", $_REQUEST["uf_use_dir"]); $gBitSystem->storePreference("userfiles_quota", $_REQUEST["userfiles_quota"]); - $smarty->assign('uf_use_db', $_REQUEST["uf_use_db"]); - $smarty->assign('uf_use_dir', $_REQUEST["uf_use_dir"]); - $smarty->assign('userfiles_quota', $_REQUEST['userfiles_quota']); + $gBitSmarty->assign('uf_use_db', $_REQUEST["uf_use_db"]); + $gBitSmarty->assign('uf_use_dir', $_REQUEST["uf_use_dir"]); + $gBitSmarty->assign('userfiles_quota', $_REQUEST['userfiles_quota']); } ?>
\ No newline at end of file diff --git a/admin/admin_users_inc.php b/admin/admin_users_inc.php index 0276661..16b4f13 100644 --- a/admin/admin_users_inc.php +++ b/admin/admin_users_inc.php @@ -48,7 +48,7 @@ if( $gBitSystem->isPackageActive( 'notepad' ) ) { ); } -$smarty->assign( 'formFeatures', $formFeatures ); +$gBitSmarty->assign( 'formFeatures', $formFeatures ); if( isset( $_REQUEST['fTiki'] ) ) { foreach ( array_keys( $formFeatures ) as $feature) { @@ -70,7 +70,7 @@ if( isset( $_REQUEST['fTiki'] ) ) { if (isset($_REQUEST["newadminpass"]) ) { if ($_REQUEST["adminpass"] <> $_REQUEST["again"]) { - $smarty->assign("msg", tra("The passwords don't match")); + $gBitSmarty->assign("msg", tra("The passwords don't match")); $gBitSystem->display( 'error.tpl' ); die; @@ -82,13 +82,13 @@ if (isset($_REQUEST["newadminpass"]) ) { $text .= " " . $min_pass_length . " "; $text .= tra("characters long"); - $smarty->assign("msg", $text); + $gBitSmarty->assign("msg", $text); $gBitSystem->display( 'error.tpl' ); die; } $gBitUser->change_user_password("admin", $_REQUEST["adminpass"]); - $smarty->assign('pagetop_msg', tra("Your admin password has been changed")); + $gBitSmarty->assign('pagetop_msg', tra("Your admin password has been changed")); } diff --git a/admin/assign_user.php b/admin/assign_user.php index ea38b3f..d1110b4 100644 --- a/admin/assign_user.php +++ b/admin/assign_user.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/assign_user.php,v 1.1 2005/06/19 05:12:23 bitweaver Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/assign_user.php,v 1.2 2005/08/01 18:42:02 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -29,7 +29,7 @@ if( isset( $_REQUEST["action"] ) ) { $assignUser->storeUserDefaultGroup( $assignUser->mUserId, $_REQUEST['default_group'] ); $assignUser->load( TRUE ); } -$smarty->assign_by_ref( 'assignUser', $assignUser ); +$gBitSmarty->assign_by_ref( 'assignUser', $assignUser ); $listHash = array( 'sort_mode' => 'group_name_asc' ); $groupList = $gBitUser->getAllGroups( $listHash ); @@ -47,31 +47,31 @@ if (isset($_REQUEST['page'])) { $page = &$_REQUEST['page']; $offset = ($page - 1) * $maxRecords; } -$smarty->assign_by_ref('offset', $offset); +$gBitSmarty->assign_by_ref('offset', $offset); if (isset($_REQUEST["find"])) { $find = $_REQUEST["find"]; } else { $find = ''; } -$smarty->assign('find', $find); +$gBitSmarty->assign('find', $find); $cant_pages = ceil($users["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$gBitSmarty->assign_by_ref('cant_pages', $cant_pages); +$gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); if ($users["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); + $gBitSmarty->assign('next_offset', $offset + $maxRecords); } else { - $smarty->assign('next_offset', -1); + $gBitSmarty->assign('next_offset', -1); } // If offset is > 0 then prev_offset if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); + $gBitSmarty->assign('prev_offset', $offset - $maxRecords); } else { - $smarty->assign('prev_offset', -1); + $gBitSmarty->assign('prev_offset', -1); } */ // Get users (list of users) -$smarty->assign('groups', $groupList['data']); +$gBitSmarty->assign('groups', $groupList['data']); $gBitSystem->setBrowserTitle( 'Edit User: '.$assignUser->mUsername ); diff --git a/admin/edit_group.php b/admin/edit_group.php index 2df3028..bbcefb3 100644 --- a/admin/edit_group.php +++ b/admin/edit_group.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/edit_group.php,v 1.1 2005/06/19 05:12:24 bitweaver Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/edit_group.php,v 1.2 2005/08/01 18:42:03 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -29,7 +29,7 @@ if( !empty( $_REQUEST['group_id'] ) ) { $groupList = $gBitUser->getAllGroups( $listHash ); } -$smarty->assign( 'package',isset( $_REQUEST['package'] ) ? $_REQUEST['package'] : 'all' ); +$gBitSmarty->assign( 'package',isset( $_REQUEST['package'] ) ? $_REQUEST['package'] : 'all' ); if( !empty( $_REQUEST["cancel"] ) ) { header( 'Location: '.USERS_PKG_URL.'admin/edit_group.php' ); @@ -51,9 +51,9 @@ $gBitUser->batchAssignUsersToGroup( $_REQUEST['batch_assign'] ); } elseif( isset($_REQUEST["members"] ) ) { $groupInfo = $gBitUser->getGroupInfo( $_REQUEST["members"] ); - $smarty->assign_by_ref( 'groupInfo', $groupInfo ); + $gBitSmarty->assign_by_ref( 'groupInfo', $groupInfo ); $groupMembers = $gBitUser->get_group_users( $_REQUEST["members"] ); - $smarty->assign_by_ref( 'groupMembers', $groupMembers ); + $gBitSmarty->assign_by_ref( 'groupMembers', $groupMembers ); $mid = "bitpackage:users/group_list_members.tpl"; $gBitSystem->setBrowserTitle( tra( 'Group Members' ).': '.$groupInfo['group_name'] ); } elseif( isset($_REQUEST["save"] ) ) { @@ -88,17 +88,19 @@ $gBitUser->batchAssignUsersToGroup( $_REQUEST['batch_assign'] ); } elseif (isset($_REQUEST['updateperms'])) { $updatePerms = $gBitUser->getgroupPermissions( $_REQUEST['group_id'] ); - foreach (array_keys($_REQUEST['level'])as $per) { - if( $allPerms[$per]['level'] != $_REQUEST['level'][$per] ) { - // we changed level. perm[] checkbox is not taken into account - $gBitUser->change_permission_level($per, $_REQUEST['level'][$per]); - } - if( isset($_REQUEST['perm'][$per]) && !isset($updatePerms[$per]) ) { - // we have an unselected perm that is now selected - $gBitUser->assignPermissionToGroup($per, $_REQUEST['group_id']); - } elseif( empty($_REQUEST['perm'][$per]) && isset($updatePerms[$per]) ) { - // we have a selected perm that is now UNselected - $gBitUser->remove_permission_from_group($per, $_REQUEST['group_id']); + if (!empty($_REQUEST['level'])) { + foreach (array_keys($_REQUEST['level'])as $per) { + if( $allPerms[$per]['level'] != $_REQUEST['level'][$per] ) { + // we changed level. perm[] checkbox is not taken into account + $gBitUser->change_permission_level($per, $_REQUEST['level'][$per]); + } + if( isset($_REQUEST['perm'][$per]) && !isset($updatePerms[$per]) ) { + // we have an unselected perm that is now selected + $gBitUser->assignPermissionToGroup($per, $_REQUEST['group_id']); + } elseif( empty($_REQUEST['perm'][$per]) && isset($updatePerms[$per]) ) { + // we have a selected perm that is now UNselected + $gBitUser->remove_permission_from_group($per, $_REQUEST['group_id']); + } } } // let's reload just to be safe. @@ -130,7 +132,7 @@ $cList['NULL'] = ''; foreach( $contentList['data'] as $cItem ) { $cList[$contentTypes[$cItem['content_type_guid']]][$cItem['content_id']] = $cItem['title'].' [id: '.$cItem['content_id'].']'; } -$smarty->assign( 'contentList', $cList ); +$gBitSmarty->assign( 'contentList', $cList ); $inc = array(); if( empty( $mid ) ) { @@ -143,10 +145,10 @@ if( empty( $mid ) ) { } $levels = $gBitUser->get_permission_levels(); sort($levels); - $smarty->assign('levels', $levels); - $smarty->assign_by_ref('defaultGroupId', $gBitSystem->getPreference( 'default_home_group' ) ); - $smarty->assign_by_ref('groupInfo', $groupInfo); - $smarty->assign_by_ref( 'allPerms', $allPerms ); + $gBitSmarty->assign('levels', $levels); + $gBitSmarty->assign_by_ref('defaultGroupId', $gBitSystem->getPreference( 'default_home_group' ) ); + $gBitSmarty->assign_by_ref('groupInfo', $groupInfo); + $gBitSmarty->assign_by_ref( 'allPerms', $allPerms ); $gBitSystem->setBrowserTitle( tra( 'Admininster Group' ).': '.$groupInfo['group_name'].' '.(isset( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '') ); $mid = 'bitpackage:users/admin_group_edit.tpl'; @@ -156,11 +158,11 @@ if( empty( $mid ) ) { $mid = 'bitpackage:users/admin_groups_list.tpl'; } } -$smarty->assign('groups', $groupList['data']); -$smarty->assign('successMsg',$successMsg); -$smarty->assign('errorMsg',$errorMsg); +$gBitSmarty->assign('groups', $groupList['data']); +$gBitSmarty->assign('successMsg',$successMsg); +$gBitSmarty->assign('errorMsg',$errorMsg); // probably obsolete now -//$smarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'edit').'TabSelect', 'tdefault' ); +//$gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'edit').'TabSelect', 'tdefault' ); // Display the template for group administration diff --git a/admin/index.php b/admin/index.php index 9039b44..9c81a2a 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_users/admin/index.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/admin/index.php,v 1.4 2005/08/01 18:42:03 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -7,14 +7,14 @@ require_once( '../../bit_setup_inc.php' ); function batchImportUsers() { - global $smarty; + global $gBitSmarty; $fname = $_FILES['csvlist']['tmp_name']; $fhandle = fopen($fname, "r"); //Get the field names $fields = fgetcsv($fhandle, 1000); //any? if (!$fields[0]) { - $smarty->assign('msg', tra("The file is not a CSV file or has not a correct syntax")); + $gBitSmarty->assign('msg', tra("The file is not a CSV file or has not a correct syntax")); $gBitSystem->display( 'error.tpl' ); die; } @@ -30,7 +30,7 @@ function batchImportUsers() { fclose ($fhandle); // any? if (!is_array($userrecs)) { - $smarty->assign('msg', tra("No records were found. Check the file please!")); + $gBitSmarty->assign('msg', tra("No records were found. Check the file please!")); $gBitSystem->display( 'error.tpl' ); die; } @@ -57,11 +57,11 @@ function batchImportUsers() { $i++; } - $smarty->assign('added', $added); + $gBitSmarty->assign('added', $added); if (@is_array($discarded)) { - $smarty->assign('discarded', count($discarded)); + $gBitSmarty->assign('discarded', count($discarded)); } - @$smarty->assign_by_ref('discardlist', $discarded); + @$gBitSmarty->assign_by_ref('discardlist', $discarded); } $gBitSystem->verifyPermission( 'bit_p_admin_users' ); @@ -76,10 +76,10 @@ if (isset($_REQUEST["newuser"])) { // jht 2005-06-22_23:51:58 flag this user store as coming from admin page -- a kludge $_REQUEST['admin_add'] = 1; if( $newUser->store( $_REQUEST ) ) { - $smarty->assign( 'addSuccess', "User Added Successfully" ); + $gBitSmarty->assign( 'addSuccess', "User Added Successfully" ); } else { - $smarty->assign_by_ref( 'newUser', $_REQUEST ); - $smarty->assign( 'errors', $newUser->mErrors ); + $gBitSmarty->assign_by_ref( 'newUser', $_REQUEST ); + $gBitSmarty->assign( 'errors', $newUser->mErrors ); } // if no user data entered, check if it's a batch upload } elseif( isset( $_REQUEST["batchimport"]) ) { @@ -137,28 +137,28 @@ if (isset($_REQUEST["action"])) { // get default group and pass it to tpl foreach( $gBitUser->getDefaultGroup() as $defaultGroupId => $defaultGroupName ) { - $smarty->assign('defaultGroupId', $defaultGroupId ); - $smarty->assign('defaultGroupName', $defaultGroupName ); + $gBitSmarty->assign('defaultGroupId', $defaultGroupId ); + $gBitSmarty->assign('defaultGroupName', $defaultGroupName ); } $_REQUEST['max_records'] = 20; $gBitUser->getList( $_REQUEST ); -$smarty->assign_by_ref('users', $_REQUEST["data"]); -$smarty->assign_by_ref('usercount', $_REQUEST["cant"]); +$gBitSmarty->assign_by_ref('users', $_REQUEST["data"]); +$gBitSmarty->assign_by_ref('usercount', $_REQUEST["cant"]); if (isset($_REQUEST["numrows"])) $_REQUEST["control"]["numrows"] = $_REQUEST["numrows"]; else $_REQUEST["control"]["numrows"] = 10; $_REQUEST["control"]["URL"] = USERS_PKG_URL."admin/index.php"; -$smarty->assign_by_ref('control', $_REQUEST["control"]); +$gBitSmarty->assign_by_ref('control', $_REQUEST["control"]); // Get groups (list of groups) $grouplist = $gBitUser->getGroups('', '', 'group_name_asc'); -$smarty->assign( 'grouplist', $grouplist ); -$smarty->assign( 'feedback', $feedback ); +$gBitSmarty->assign( 'grouplist', $grouplist ); +$gBitSmarty->assign( 'feedback', $feedback ); -$smarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'userlist').'TabSelect', 'tdefault' ); +$gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'userlist').'TabSelect', 'tdefault' ); // Display the template $gBitSystem->display( 'bitpackage:users/users_admin.tpl', (!empty( $title ) ? $title : 'Edit Users' ) ); diff --git a/assigned_modules.php b/assigned_modules.php index 236aaf8..85f8e43 100644 --- a/assigned_modules.php +++ b/assigned_modules.php @@ -3,13 +3,13 @@ * assigned_modules * * @author spider <spider@steelsun.com> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @package users * @subpackage functions * @copyright Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. * @license Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. */ -// $Header: /cvsroot/bitweaver/_bit_users/assigned_modules.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $ +// $Header: /cvsroot/bitweaver/_bit_users/assigned_modules.php,v 1.3 2005/08/01 18:42:01 squareing Exp $ // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Initialization @@ -25,13 +25,13 @@ include_once( KERNEL_PKG_PATH.'mod_lib.php' ); $gBitSystem->verifyPermission('bit_p_configure_modules'); if ($gBitSystem->getPreference('feature_user_layout') != 'y' && $gBitSystem->getPreference('feature_user_layout') != 'h' && $gBitSystem->getPreference('feature_user_theme') != 'y' && $gBitSystem->getPreference('feature_user_theme') != 'h') { - $smarty->assign('msg', tra("This feature is disabled").": user layout"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": user layout"); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->isRegistered()) { - $smarty->assign('msg', tra("Permission denied: You are not logged in")); + $gBitSmarty->assign('msg', tra("Permission denied: You are not logged in")); $gBitSystem->display( 'error.tpl' ); die; } @@ -39,7 +39,7 @@ if (!$gBitUser->isRegistered()) { include_once(USERS_PKG_PATH.'lookup_user_inc.php'); if ($gQueryUser->mUserId != $gBitUser->mUserId && !$gBitUser->object_has_permission($gBitUser->mUserId, $gQueryUser->mInfo['content_id'], 'bituser', 'bit_p_admin_user')) { - $smarty->assign('msg', tra('You do not have permission to edit this user\'s theme')); + $gBitSmarty->assign('msg', tra('You do not have permission to edit this user\'s theme')); $gBitSystem->display('error.tpl'); die; } @@ -61,7 +61,7 @@ if (isset($_REQUEST['fSubmitSetTheme'] ) ) { $fAssign['user_id'] = $gQueryUser->mUserId; $fAssign['layout'] = $_REQUEST['fLayout']; $modlib->storeLayout( $fAssign ); - $smarty->assign_by_ref( 'fAssign', $fAssign ); + $gBitSmarty->assign_by_ref( 'fAssign', $fAssign ); } elseif (isset($_REQUEST["fMove"])) { if( isset( $_REQUEST["fMove"] ) && isset( $_REQUEST["fModule"] ) ) { @@ -88,31 +88,31 @@ $orders = array(); for ($i = 1; $i < 20; $i++) { $orders[] = $i; } -$smarty->assign_by_ref('orders', $orders); -$smarty->assign( 'homeHeaderData', $gQueryUser->getPreference( 'homepage_header' ) ); +$gBitSmarty->assign_by_ref('orders', $orders); +$gBitSmarty->assign( 'homeHeaderData', $gQueryUser->getPreference( 'homepage_header' ) ); // get styles if( $gBitSystem->getPreference('feature_user_theme') ) { include_once( THEMES_PKG_PATH.'theme_control_lib.php' ); $styles = &$tcontrollib->getStyles( NULL, TRUE, TRUE ); - $smarty->assign_by_ref( 'styles', $styles ); + $gBitSmarty->assign_by_ref( 'styles', $styles ); if(!isset($_REQUEST["style"])){ $assignStyle = $gQueryUser->getPreference( 'theme' ); } - $smarty->assign( 'assignStyle', $assignStyle ); + $gBitSmarty->assign( 'assignStyle', $assignStyle ); } $assignables = $modlib->getAssignableModules(); if (count($assignables) > 0) { - $smarty->assign('canassign', 'y'); + $gBitSmarty->assign('canassign', 'y'); } else { - $smarty->assign('canassign', 'n'); + $gBitSmarty->assign('canassign', 'n'); } $modules = $gBitSystem->getLayout( $gQueryUser->mUserId, HOMEPAGE_LAYOUT, FALSE ); $modlib->generateModuleNames( $modules ); //print_r($modules); -$smarty->assign_by_ref('assignables', $assignables); +$gBitSmarty->assign_by_ref('assignables', $assignables); $layoutAreas = array( 'left'=>'l', 'center'=>'c', 'right'=>'r' ); -$smarty->assign_by_ref( 'layoutAreas', $layoutAreas ); -$smarty->assign_by_ref('modules', $modules); +$gBitSmarty->assign_by_ref( 'layoutAreas', $layoutAreas ); +$gBitSmarty->assign_by_ref('modules', $modules); //print_r($modules); diff --git a/bit_setup_inc.php b/bit_setup_inc.php index 9ddbd11..7443016 100644 --- a/bit_setup_inc.php +++ b/bit_setup_inc.php @@ -1,5 +1,5 @@ <?php -global $gBitSystem, $gBitUser, $smarty; +global $gBitSystem, $gBitUser, $gBitSmarty; $gBitSystem->registerPackage( 'users', dirname( __FILE__).'/', FALSE ); @@ -122,8 +122,8 @@ if( !defined( 'LOGO_MAX_DIM' ) ) { $gBitUser->updateSession(session_id()); } - $smarty->assign_by_ref('gBitUser', $gBitUser); - $smarty->register_object('gBitUser', $gBitUser, array(), true, array('hasPermission')); + $gBitSmarty->assign_by_ref('gBitUser', $gBitUser); + $gBitSmarty->register_object('gBitUser', $gBitUser, array(), true, array('hasPermission')); $allowRegister = $gBitSystem->getPreference("allowRegister", 'y'); $validateUsers = $gBitSystem->getPreference("validateUsers", 'n'); @@ -142,53 +142,53 @@ if( !defined( 'LOGO_MAX_DIM' ) ) { $https_login_required = $gBitSystem->getPreference('https_login_required', 'n'); $change_language = $gBitSystem->getPreference("change_language", 'y'); - $smarty->assign('allowRegister', $allowRegister); - $smarty->assign('urlIndex', $urlIndex); - $smarty->assign('use_proxy', $use_proxy); - $smarty->assign('proxy_host', $proxy_host); - $smarty->assign('proxy_port', $proxy_port); - $smarty->assign('change_language', $change_language); - $smarty->assign('eponymousGroups', $eponymousGroups); + $gBitSmarty->assign('allowRegister', $allowRegister); + $gBitSmarty->assign('urlIndex', $urlIndex); + $gBitSmarty->assign('use_proxy', $use_proxy); + $gBitSmarty->assign('proxy_host', $proxy_host); + $gBitSmarty->assign('proxy_port', $proxy_port); + $gBitSmarty->assign('change_language', $change_language); + $gBitSmarty->assign('eponymousGroups', $eponymousGroups); $user_assigned_modules = 'n'; - $smarty->assign('remembertime', $remembertime); - $smarty->assign('webserverauth', 'n'); - $smarty->assign('uf_use_db', 'y'); - $smarty->assign('uf_use_dir', ''); - $smarty->assign('userfiles_quota', 30); - $smarty->assign('registerPasscode', $registerPasscode); - $smarty->assign('useRegisterPasscode', $useRegisterPasscode); - $smarty->assign('min_pass_length', 1); - $smarty->assign('pass_chr_num', 'n'); - $smarty->assign('pass_due', 999); - $smarty->assign('rnd_num_reg', 'n'); + $gBitSmarty->assign('remembertime', $remembertime); + $gBitSmarty->assign('webserverauth', 'n'); + $gBitSmarty->assign('uf_use_db', 'y'); + $gBitSmarty->assign('uf_use_dir', ''); + $gBitSmarty->assign('userfiles_quota', 30); + $gBitSmarty->assign('registerPasscode', $registerPasscode); + $gBitSmarty->assign('useRegisterPasscode', $useRegisterPasscode); + $gBitSmarty->assign('min_pass_length', 1); + $gBitSmarty->assign('pass_chr_num', 'n'); + $gBitSmarty->assign('pass_due', 999); + $gBitSmarty->assign('rnd_num_reg', 'n'); // PEAR::Auth support - $smarty->assign('auth_method', "tiki"); - $smarty->assign('auth_pear', "tiki"); - $smarty->assign('auth_create_gBitDbUser', 'n'); - $smarty->assign('auth_create_user_auth', 'n'); - $smarty->assign('auth_skip_admin', 'y'); - $smarty->assign('auth_ldap_host', 'localhost'); - $smarty->assign('auth_ldap_port', '389'); - $smarty->assign('auth_ldap_scope', 'sub'); - $smarty->assign('auth_ldap_basedn', ''); - $smarty->assign('auth_ldap_userdn', ''); - $smarty->assign('auth_ldap_userattr', 'uid'); - $smarty->assign('auth_ldap_useroc', 'inetOrgPerson'); - $smarty->assign('auth_ldap_groupdn', ''); - $smarty->assign('auth_ldap_groupattr', 'cn'); - $smarty->assign('auth_ldap_groupoc', 'groupOfUniqueNames'); - $smarty->assign('auth_ldap_memberattr', 'uniqueMember'); - $smarty->assign('auth_ldap_memberisdn', 'y'); - $smarty->assign('auth_ldap_adminuser', ''); - $smarty->assign('auth_ldap_adminpass', ''); + $gBitSmarty->assign('auth_method', "tiki"); + $gBitSmarty->assign('auth_pear', "tiki"); + $gBitSmarty->assign('auth_create_gBitDbUser', 'n'); + $gBitSmarty->assign('auth_create_user_auth', 'n'); + $gBitSmarty->assign('auth_skip_admin', 'y'); + $gBitSmarty->assign('auth_ldap_host', 'localhost'); + $gBitSmarty->assign('auth_ldap_port', '389'); + $gBitSmarty->assign('auth_ldap_scope', 'sub'); + $gBitSmarty->assign('auth_ldap_basedn', ''); + $gBitSmarty->assign('auth_ldap_userdn', ''); + $gBitSmarty->assign('auth_ldap_userattr', 'uid'); + $gBitSmarty->assign('auth_ldap_useroc', 'inetOrgPerson'); + $gBitSmarty->assign('auth_ldap_groupdn', ''); + $gBitSmarty->assign('auth_ldap_groupattr', 'cn'); + $gBitSmarty->assign('auth_ldap_groupoc', 'groupOfUniqueNames'); + $gBitSmarty->assign('auth_ldap_memberattr', 'uniqueMember'); + $gBitSmarty->assign('auth_ldap_memberisdn', 'y'); + $gBitSmarty->assign('auth_ldap_adminuser', ''); + $gBitSmarty->assign('auth_ldap_adminpass', ''); // Permissions // Get group permissions here if (is_array($gBitUser->mPerms)) { // This avoids php warning during install foreach( array_keys( $gBitUser->mPerms ) as $perm ) { // print("Asignando permiso global : $perm<br/>"); - $smarty->assign("$perm", 'y'); + $gBitSmarty->assign("$perm", 'y'); $$perm = 'y'; } } @@ -198,11 +198,11 @@ if( !defined( 'LOGO_MAX_DIM' ) ) { include_once(USERS_PKG_PATH . 'user_menu_lib.php'); $user_menus = $usermenulib->list_usermenus($gBitUser->mUserId, 0, -1, 'position_asc', ''); - $smarty->assign('usr_user_menus', $user_menus['data']); + $gBitSmarty->assign('usr_user_menus', $user_menus['data']); $_SESSION['usermenu'] = $user_menus['data']; } else { $user_menus = $_SESSION['usermenu']; - $smarty->assign('usr_user_menus', $user_menus); + $gBitSmarty->assign('usr_user_menus', $user_menus); } } // If we are processing a login then do not generate the challenge @@ -212,11 +212,11 @@ if( !defined( 'LOGO_MAX_DIM' ) ) { $chall = $gBitUser->generateChallenge(); $_SESSION["challenge"] = $chall; - $smarty->assign('challenge', $chall); + $gBitSmarty->assign('challenge', $chall); } } - $smarty->assign('user_dbl', 'y'); + $gBitSmarty->assign('user_dbl', 'y'); $allowMsgs = 'n'; if( $gBitUser->isRegistered() ) { @@ -224,9 +224,9 @@ if( !defined( 'LOGO_MAX_DIM' ) ) { $allowMsgs = $gBitUser->getPreference( 'allowMsgs', 'y'); $tasks_use_dates = $gBitUser->getPreference( 'tasks_use_dates'); $tasks_maxRecords = $gBitUser->getPreference( 'tasks_maxRecords'); - $smarty->assign('tasks_use_dates', $tasks_use_dates); - $smarty->assign('tasks_maxRecords', $tasks_maxRecords); - $smarty->assign('allowMsgs', $allowMsgs); + $gBitSmarty->assign('tasks_use_dates', $tasks_use_dates); + $gBitSmarty->assign('tasks_maxRecords', $tasks_maxRecords); + $gBitSmarty->assign('allowMsgs', $allowMsgs); } ?> diff --git a/bookmarks.php b/bookmarks.php index 0b4fae8..9d53a75 100644 --- a/bookmarks.php +++ b/bookmarks.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/Attic/bookmarks.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/Attic/bookmarks.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: bookmarks.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $ + * $Id: bookmarks.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,17 +19,17 @@ require_once( '../bit_setup_inc.php' ); include_once( USERS_PKG_PATH.'bookmark_lib.php' ); if (!$gBitUser->hasPermission( 'bit_p_create_bookmarks' )) { - $smarty->assign('msg', tra("You dont have permission to use this feature")); + $gBitSmarty->assign('msg', tra("You dont have permission to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->mUserId) { - $smarty->assign('msg', tra("You must log in to use this feature")); + $gBitSmarty->assign('msg', tra("You must log in to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } if ($feature_user_bookmarks != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_user_bookmarks"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_user_bookmarks"); $gBitSystem->display( 'error.tpl' ); die; } @@ -44,8 +44,8 @@ if ($_REQUEST["parent_id"]) { $path = tra("TOP"); $father = 0; } -$smarty->assign('parent_id', $_REQUEST["parent_id"]); -$smarty->assign('path', $path); +$gBitSmarty->assign('parent_id', $_REQUEST["parent_id"]); +$gBitSmarty->assign('path', $path); //chekck for edit folder if (isset($_REQUEST["editfolder"])) { $folder_info = $bookmarklib->get_folder($_REQUEST["editfolder"], $gBitUser->mUserId); @@ -53,8 +53,8 @@ if (isset($_REQUEST["editfolder"])) { $folder_info["name"] = ''; $_REQUEST["editfolder"] = 0; } -$smarty->assign('foldername', $folder_info["name"]); -$smarty->assign('editfolder', $_REQUEST["editfolder"]); +$gBitSmarty->assign('foldername', $folder_info["name"]); +$gBitSmarty->assign('editfolder', $_REQUEST["editfolder"]); if (isset($_REQUEST["editurl"])) { $url_info = $bookmarklib->get_url($_REQUEST["editurl"]); } else { @@ -62,16 +62,16 @@ if (isset($_REQUEST["editurl"])) { $url_info["url"] = ''; $_REQUEST["editurl"] = 0; } -$smarty->assign('urlname', $url_info["name"]); -$smarty->assign('urlurl', $url_info["url"]); -$smarty->assign('editurl', $_REQUEST["editurl"]); +$gBitSmarty->assign('urlname', $url_info["name"]); +$gBitSmarty->assign('urlurl', $url_info["url"]); +$gBitSmarty->assign('editurl', $_REQUEST["editurl"]); // Create a folder inside the parentFolder here if (isset($_REQUEST["addfolder"])) { if ($_REQUEST["editfolder"]) { $bookmarklib->update_folder($_REQUEST["editfolder"], $_REQUEST["foldername"], $gBitUser->mUserId); - $smarty->assign('editfolder', 0); - $smarty->assign('foldername', ''); + $gBitSmarty->assign('editfolder', 0); + $gBitSmarty->assign('foldername', ''); } else { $bookmarklib->add_folder($_REQUEST["parent_id"], $_REQUEST["foldername"], $gBitUser->mUserId); } @@ -90,11 +90,11 @@ if (isset($_REQUEST["addurl"])) { if ($_REQUEST["editurl"] == 0 && $gBitUser->hasPermission( 'bit_p_cache_bookmarks' )) { $bookmarklib->refresh_url($urlid); } - $smarty->assign('editurl', 0); - $smarty->assign('urlname', ''); - $smarty->assign('urlurl', ''); + $gBitSmarty->assign('editurl', 0); + $gBitSmarty->assign('urlname', ''); + $gBitSmarty->assign('urlurl', ''); } else { - $smarty->assign( 'bookmarkError', "URL CANNOT BE MORE THAN 250 characters" ); + $gBitSmarty->assign( 'bookmarkError', "URL CANNOT BE MORE THAN 250 characters" ); } } if (isset($_REQUEST["removeurl"])) { @@ -102,7 +102,7 @@ if (isset($_REQUEST["removeurl"])) { $bookmarklib->remove_url($_REQUEST["removeurl"], $gBitUser->mUserId); } $urls = $bookmarklib->list_folder($_REQUEST["parent_id"], 0, -1, 'name_asc', '', $gBitUser->mUserId); -$smarty->assign('urls', $urls["data"]); +$gBitSmarty->assign('urls', $urls["data"]); $folders = $bookmarklib->get_child_folders($_REQUEST["parent_id"], $gBitUser->mUserId); $pf = array( "name" => "..", @@ -114,7 +114,7 @@ $pfs = array($pf); if ($_REQUEST["parent_id"]) { $folders = array_merge($pfs, $folders); } -$smarty->assign('folders', $folders); +$gBitSmarty->assign('folders', $folders); // Display the template $gBitSystem->display( 'bitpackage:users/user_bookmarks.tpl'); diff --git a/cached_bookmark.php b/cached_bookmark.php index eca8396..cde7855 100644 --- a/cached_bookmark.php +++ b/cached_bookmark.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/Attic/cached_bookmark.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/Attic/cached_bookmark.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: cached_bookmark.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $ + * $Id: cached_bookmark.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,23 +19,23 @@ require_once( '../bit_setup_inc.php' ); include_once( USERS_PKG_PATH.'bookmark_lib.php' ); if (!$gBitUser->mUserId) { - $smarty->assign('msg', tra("You must log in to use this feature")); + $gBitSmarty->assign('msg', tra("You must log in to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } if ($feature_user_bookmarks != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_user_bookmarks"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_user_bookmarks"); $gBitSystem->display( 'error.tpl' ); die; } if (!isset($_REQUEST["urlid"])) { - $smarty->assign('msg', tra("No url indicated")); + $gBitSmarty->assign('msg', tra("No url indicated")); $gBitSystem->display( 'error.tpl' ); die; } // Get a list of last changes to the Wiki database $info = $bookmarklib->get_url($_REQUEST["urlid"]); -$smarty->assign_by_ref('info', $info); +$gBitSmarty->assign_by_ref('info', $info); $info["refresh"] = $info["last_updated"]; $gBitSystem->display( 'bitpackage:kernel/view_cache.tpl'); ?> diff --git a/change_password.php b/change_password.php index 9e9179c..e17dfba 100644 --- a/change_password.php +++ b/change_password.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/change_password.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/change_password.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: change_password.php,v 1.2 2005/06/28 07:46:22 spiderr Exp $ + * $Id: change_password.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -21,8 +21,8 @@ if (!isset($_REQUEST['login'])) $_REQUEST['login'] = ''; if (!isset($_REQUEST["oldpass"])) $_REQUEST["oldpass"] = ''; -$smarty->assign('login', $_REQUEST['login']); -$smarty->assign('oldpass', $_REQUEST["oldpass"]); +$gBitSmarty->assign('login', $_REQUEST['login']); +$gBitSmarty->assign('oldpass', $_REQUEST["oldpass"]); if (isset($_REQUEST["change"])) { if ($_REQUEST["pass"] != $_REQUEST["pass2"]) { @@ -41,7 +41,7 @@ if (isset($_REQUEST["change"])) { // Check this code if ($pass_chr_num == 'y') { if (!preg_match_all("/[0-9]+/", $_REQUEST["pass"], $foo) || !preg_match_all("/[A-Za-z]+/", $_REQUEST["pass"], $foo)) { - $smarty->assign('msg', tra("Password must contain both letters and numbers")); + $gBitSmarty->assign('msg', tra("Password must contain both letters and numbers")); $gBitSystem->display( 'error.tpl' ); die; } diff --git a/confirm.php b/confirm.php index 8c7afd8..278cea7 100644 --- a/confirm.php +++ b/confirm.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/confirm.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/confirm.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: confirm.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: confirm.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,10 +19,10 @@ require_once( '../bit_setup_inc.php' ); if( $userInfo = $gBitUser->confirmRegistration( $_REQUEST["user"], $_REQUEST["pass"] ) ) { - $smarty->assign_by_ref( 'userInfo', $userInfo ); + $gBitSmarty->assign_by_ref( 'userInfo', $userInfo ); $gBitSystem->display( 'bitpackage:users/change_password.tpl' ); } else { - $smarty->assign('msg', tra("Invalid username or password")); + $gBitSmarty->assign('msg', tra("Invalid username or password")); $gBitSystem->display( 'error.tpl' ); } ?> diff --git a/custom_home.php b/custom_home.php index 6424b2a..d164d7f 100644 --- a/custom_home.php +++ b/custom_home.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/custom_home.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/custom_home.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: custom_home.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: custom_home.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -34,7 +34,7 @@ $b = $nntp->getBody(1); print_r($b); */ if ($feature_custom_home != 'y') { - $smarty->assign('msg', tra("This feature has been disabled")); + $gBitSmarty->assign('msg', tra("This feature has been disabled")); $gBitSystem->display( 'error.tpl' ); die; } diff --git a/edit_personal_page.php b/edit_personal_page.php index cc047af..ab661f0 100644 --- a/edit_personal_page.php +++ b/edit_personal_page.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/edit_personal_page.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/edit_personal_page.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: edit_personal_page.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Id: edit_personal_page.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -35,14 +35,14 @@ if ($gBitSystem->getPreference('package_quicktags','n') == 'y') { // see if we should show the attachments tab at all foreach( $gLibertySystem->mPlugins as $plugin ) { if( ( $plugin['plugin_type'] == 'storage' ) && ( $plugin['is_active'] == 'y' ) ) { - $smarty->assign( 'show_attachments','y' ); + $gBitSmarty->assign( 'show_attachments','y' ); } } -$smarty->assign('preview',0); +$gBitSmarty->assign('preview',0); // If we are in preview mode then preview it! if(isset($_REQUEST["preview"])) { - $smarty->assign('preview',1); + $gBitSmarty->assign('preview',1); $gBitUser->mInfo['title'] = $_REQUEST["title"]; if(isset($_REQUEST["description"])) { $gBitUser->mInfo['description'] = $_REQUEST["description"]; @@ -56,18 +56,18 @@ if(isset($_REQUEST["preview"])) { if ($wiki_spellcheck == 'y') { if (isset($_REQUEST["spellcheck"]) && $_REQUEST["spellcheck"] == 'on') { $parsed = $gBitSystem->spellcheckreplace($edit_data, $parsed, $gBitLanguage->mLanguage, 'editwiki'); - $smarty->assign('spellcheck', 'y'); + $gBitSmarty->assign('spellcheck', 'y'); } else { - $smarty->assign('spellcheck', 'n'); + $gBitSmarty->assign('spellcheck', 'n'); } } - $smarty->assign( 'parsed', $parsed ); + $gBitSmarty->assign( 'parsed', $parsed ); } -$smarty->assign_by_ref( 'pageInfo', $gBitUser->mInfo ); -$smarty->assign_by_ref( 'gContent', $gBitUser ); +$gBitSmarty->assign_by_ref( 'pageInfo', $gBitUser->mInfo ); +$gBitSmarty->assign_by_ref( 'gContent', $gBitUser ); -$smarty->assign('show_page_bar', 'y'); +$gBitSmarty->assign('show_page_bar', 'y'); $gBitSystem->mPrefs['feature_wiki_description'] = 'n'; $gBitSystem->display( 'bitpackage:wiki/edit_page.tpl'); @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/Attic/files.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/Attic/files.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: files.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: files.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,17 +19,17 @@ require_once( '../bit_setup_inc.php' ); include_once ( USERS_PKG_PATH.'userfiles_lib.php'); if ($feature_userfiles != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_userfiles"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_userfiles"); $gBitSystem->display( 'error.tpl' ); die; } if ( !$gBitUser->isValid() ) { - $smarty->assign('msg', tra("Must be logged to use this feature")); + $gBitSmarty->assign('msg', tra("Must be logged to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->hasPermission( 'bit_p_userfiles' )) { - $smarty->assign('msg', tra("Permission denied to use this feature")); + $gBitSmarty->assign('msg', tra("Permission denied to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } @@ -40,8 +40,8 @@ if ($limit == 0) $percentage = ($quota / $limit) * 100; $cellsize = round($percentage / 100 * 200); $percentage = round($percentage); -$smarty->assign('cellsize', $cellsize); -$smarty->assign('percentage', $percentage); +$gBitSmarty->assign('cellsize', $cellsize); +$gBitSmarty->assign('percentage', $percentage); // Process upload here for ($i = 0; $i < 5; $i++) { if (isset($_FILES["userfile$i"]) && is_uploaded_file($_FILES["userfile$i"]['tmp_name'])) { @@ -54,7 +54,7 @@ for ($i = 0; $i < 5; $i++) { $fhash = md5(uniqid('.')); $fw = fopen($uf_use_dir . $fhash, "wb"); if (!$fw) { - $smarty->assign('msg', tra('Cannot write to this file:'). $fhash); + $gBitSmarty->assign('msg', tra('Cannot write to this file:'). $fhash); $gBitSystem->display( 'error.tpl' ); die; } @@ -76,7 +76,7 @@ for ($i = 0; $i < 5; $i++) { $name = $_FILES["userfile$i"]['name']; $type = $_FILES["userfile$i"]['type']; if ($quota + $size > $limit) { - $smarty->assign('msg', tra('Cannot upload this file not enough quota')); + $gBitSmarty->assign('msg', tra('Cannot upload this file not enough quota')); $gBitSystem->display( 'error.tpl' ); die; } @@ -99,8 +99,8 @@ $cellsize = round($percentage / 100 * 200); $percentage = round($percentage); if ($cellsize == 0) $cellsize = 1; -$smarty->assign('cellsize', $cellsize); -$smarty->assign('percentage', $percentage); +$gBitSmarty->assign('cellsize', $cellsize); +$gBitSmarty->assign('percentage', $percentage); if ( empty( $_REQUEST["sort_mode"] ) ) { $sort_mode = 'created_desc'; } else { @@ -115,14 +115,14 @@ if (isset($_REQUEST['page'])) { $page = &$_REQUEST['page']; $offset = ($page - 1) * $maxRecords; } -$smarty->assign_by_ref('offset', $offset); +$gBitSmarty->assign_by_ref('offset', $offset); if (isset($_REQUEST["find"])) { $find = $_REQUEST["find"]; } else { $find = ''; } -$smarty->assign('find', $find); -$smarty->assign_by_ref('sort_mode', $sort_mode); +$gBitSmarty->assign('find', $find); +$gBitSmarty->assign_by_ref('sort_mode', $sort_mode); if (isset($_SESSION['thedate'])) { $pdate = $_SESSION['thedate']; } else { @@ -130,21 +130,21 @@ if (isset($_SESSION['thedate'])) { } $channels = $userfileslib->list_userfiles($gBitUser->mUserId, $offset, $maxRecords, $sort_mode, $find); $cant_pages = ceil($channels["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$gBitSmarty->assign_by_ref('cant_pages', $cant_pages); +$gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); + $gBitSmarty->assign('next_offset', $offset + $maxRecords); } else { - $smarty->assign('next_offset', -1); + $gBitSmarty->assign('next_offset', -1); } // If offset is > 0 then prev_offset if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); + $gBitSmarty->assign('prev_offset', $offset - $maxRecords); } else { - $smarty->assign('prev_offset', -1); + $gBitSmarty->assign('prev_offset', -1); } -$smarty->assign_by_ref('channels', $channels["data"]); -$smarty->assign('tasks_use_dates', $tasks_use_dates); +$gBitSmarty->assign_by_ref('channels', $channels["data"]); +$gBitSmarty->assign('tasks_use_dates', $tasks_use_dates); $gBitSystem->display( 'bitpackage:users/userfiles.tpl'); ?> @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/index.php,v 1.5 2005/07/25 20:02:54 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/index.php,v 1.6 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: index.php,v 1.5 2005/07/25 20:02:54 squareing Exp $ + * $Id: index.php,v 1.6 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -25,7 +25,7 @@ require_once( LIBERTY_PKG_PATH."LibertyStructure.php" ); // custom userfields if( !empty( $gBitSystem->mPrefs['custom_user_fields'] ) ) { $customFields= explode( ',', $gBitSystem->mPrefs['custom_user_fields'] ); - $smarty->assign('customFields', $customFields); + $gBitSmarty->assign('customFields', $customFields); } // lookup may be via content_id which will then return user_id for search request require_once( USERS_PKG_PATH.'lookup_user_inc.php' ); @@ -34,10 +34,10 @@ if (!empty($_REQUEST['home'])) { $search_request = $_REQUEST['home']; } if( !empty( $_REQUEST['home'] ) ) { - $smarty->assign( 'home', $_REQUEST['home'] ); + $gBitSmarty->assign( 'home', $_REQUEST['home'] ); $gQueryUserId = $_REQUEST['home']; if( $gQueryUser->isValid() ) { - $smarty->assign( 'gQueryUserId', $gQueryUserId ); + $gBitSmarty->assign( 'gQueryUserId', $gQueryUserId ); } if( $gBitSystem->getPreference('feature_user_theme') ) { @@ -45,7 +45,7 @@ if( !empty( $_REQUEST['home'] ) ) { if( isset( $userHomeStyle ) ) { $gBitSystem->setStyle($userHomeStyle ); $gBitLoc['styleSheet'] = $gBitSystem->getStyleCss( $userHomeStyle, $_REQUEST['home'] ); - $smarty->assign( 'userStyle', $userHomeStyle ); + $gBitSmarty->assign( 'userStyle', $userHomeStyle ); } } $userHomeTitle = $gQueryUser->getPreference( 'homepage_title' ); @@ -71,19 +71,19 @@ if( !empty( $_REQUEST['home'] ) ) { $centerDisplay = ( count( $gCenterPieces ) ? 'bitpackage:kernel/dynamic.tpl' : 'bitpackage:users/center_user_wiki_page.tpl' ); } elseif (empty($search_request)) { $gQueryUser->getList( $_REQUEST ); - $smarty->assign('search_request',$search_request); - $smarty->assign_by_ref('users', $_REQUEST["data"]); - $smarty->assign_by_ref('usercount', $_REQUEST["cant"]); + $gBitSmarty->assign('search_request',$search_request); + $gBitSmarty->assign_by_ref('users', $_REQUEST["data"]); + $gBitSmarty->assign_by_ref('usercount', $_REQUEST["cant"]); if (isset($_REQUEST["numrows"])) $_REQUEST["control"]["numrows"] = $_REQUEST["numrows"]; else $_REQUEST["control"]["numrows"] = 50; $_REQUEST["control"]["URL"] = USERS_PKG_URL."index.php"; - $smarty->assign_by_ref('control', $_REQUEST["control"]); + $gBitSmarty->assign_by_ref('control', $_REQUEST["control"]); $centerDisplay = 'bitpackage:users/index_list.tpl'; $browserTitle = $siteTitle.' '.tra( 'Members' ); } else { - $smarty->assign('msg',tra('User not found')); + $gBitSmarty->assign('msg',tra('User not found')); $centerDisplay = 'bitpackage:kernel/error.tpl'; $browserTitle = $siteTitle.' '.tra( 'Members' ); @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/login.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/login.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: login.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: login.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -24,7 +24,7 @@ if( $gBitUser->isRegistered() ) { } if( !empty( $_REQUEST['error'] ) ) { - $smarty->assign( 'error', $_REQUEST['error'] ); + $gBitSmarty->assign( 'error', $_REQUEST['error'] ); } $gBitSystem->display( 'bitpackage:users/login.tpl'); diff --git a/lookup_user_inc.php b/lookup_user_inc.php index db2325f..112d9f0 100644 --- a/lookup_user_inc.php +++ b/lookup_user_inc.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/lookup_user_inc.php,v 1.3 2005/07/25 20:02:54 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/lookup_user_inc.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: lookup_user_inc.php,v 1.3 2005/07/25 20:02:54 squareing Exp $ + * $Id: lookup_user_inc.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -51,11 +51,11 @@ if (!$gBitUser->isAdmin()) { } $gQueryUser->sanitizeUserInfo(); -$smarty->assign_by_ref('gQueryUser', $gQueryUser); +$gBitSmarty->assign_by_ref('gQueryUser', $gQueryUser); if( $gQueryUser->isValid() ) { - $smarty->assign_by_ref( 'userInfo', $gQueryUser->mInfo ); - $smarty->assign_by_ref( 'userPrefs', $gQueryUser->mUserPrefs ); - $smarty->assign( 'homepage_header', $gQueryUser->getPreference( 'homepage_header' ) ); + $gBitSmarty->assign_by_ref( 'userInfo', $gQueryUser->mInfo ); + $gBitSmarty->assign_by_ref( 'userPrefs', $gQueryUser->mUserPrefs ); + $gBitSmarty->assign( 'homepage_header', $gQueryUser->getPreference( 'homepage_header' ) ); } ?> @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/Attic/menu.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/Attic/menu.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: menu.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: menu.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,17 +19,17 @@ require_once( '../bit_setup_inc.php' ); include_once( USERS_PKG_PATH.'user_menu_lib.php' ); if ($feature_usermenu != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_usermenu"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_usermenu"); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->mUserId) { - $smarty->assign('msg', tra("Must be logged to use this feature")); + $gBitSmarty->assign('msg', tra("Must be logged to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->hasPermission( 'bit_p_usermenu' )) { - $smarty->assign('msg', tra("Permission denied to use this feature")); + $gBitSmarty->assign('msg', tra("Permission denied to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } @@ -69,8 +69,8 @@ if (isset($_REQUEST['save'])) { $_REQUEST["menu_id"] = 0; unset ($_SESSION['usermenu']); } -$smarty->assign('menu_id', $_REQUEST["menu_id"]); -$smarty->assign('info', $info); +$gBitSmarty->assign('menu_id', $_REQUEST["menu_id"]); +$gBitSmarty->assign('info', $info); if ( empty( $_REQUEST["sort_mode"] ) ) { $sort_mode = 'position_asc'; } else { @@ -85,14 +85,14 @@ if (isset($_REQUEST['page'])) { $page = &$_REQUEST['page']; $offset = ($page - 1) * $maxRecords; } -$smarty->assign_by_ref('offset', $offset); +$gBitSmarty->assign_by_ref('offset', $offset); if (isset($_REQUEST["find"])) { $find = $_REQUEST["find"]; } else { $find = ''; } -$smarty->assign('find', $find); -$smarty->assign_by_ref('sort_mode', $sort_mode); +$gBitSmarty->assign('find', $find); +$gBitSmarty->assign_by_ref('sort_mode', $sort_mode); if (isset($_SESSION['thedate'])) { $pdate = $_SESSION['thedate']; } else { @@ -100,20 +100,20 @@ if (isset($_SESSION['thedate'])) { } $channels = $usermenulib->list_usermenus($gBitUser->mUserId, $offset, $maxRecords, $sort_mode, $find); $cant_pages = ceil($channels["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$gBitSmarty->assign_by_ref('cant_pages', $cant_pages); +$gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); + $gBitSmarty->assign('next_offset', $offset + $maxRecords); } else { - $smarty->assign('next_offset', -1); + $gBitSmarty->assign('next_offset', -1); } // If offset is > 0 then prev_offset if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); + $gBitSmarty->assign('prev_offset', $offset - $maxRecords); } else { - $smarty->assign('prev_offset', -1); + $gBitSmarty->assign('prev_offset', -1); } -$smarty->assign_by_ref('channels', $channels["data"]); +$gBitSmarty->assign_by_ref('channels', $channels["data"]); $gBitSystem->display( 'bitpackage:users/usermenu.tpl'); ?> diff --git a/module_controls_inc.php b/module_controls_inc.php index d2a0957..76f6a17 100644 --- a/module_controls_inc.php +++ b/module_controls_inc.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/module_controls_inc.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/module_controls_inc.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: module_controls_inc.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: module_controls_inc.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -18,17 +18,17 @@ $check_req = (isset($_REQUEST["mc_unassign"]) || isset($_REQUEST["mc_down"]) || isset($_REQUEST["mc_move"])); if (!$gBitUser->hasPermission( 'bit_p_configure_modules' ) && $check_req) { - $smarty->assign('msg', tra("You dont have permission to use this feature")); + $gBitSmarty->assign('msg', tra("You dont have permission to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } if ($user_assigned_modules != 'y' && $check_req) { - $smarty->assign('msg', tra("This feature is disabled").": user_assigned_modules"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": user_assigned_modules"); $gBitSystem->display( 'error.tpl' ); die; } if ( !$gBitUser->isRegistered() && $check_req) { - $smarty->assign('msg', tra("You must log in to use this feature")); + $gBitSmarty->assign('msg', tra("You must log in to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } @@ -55,6 +55,6 @@ if ($check_req) { } // Fix locaton if parameter was removed... if ($url != $_SERVER["REQUEST_URI"]) header('location: '.$url); -$smarty->assign('current_location', $url); -$smarty->assign('mpchar', (strpos($url, '?') ? '&' : '?')); +$gBitSmarty->assign('current_location', $url); +$gBitSmarty->assign('mpchar', (strpos($url, '?') ? '&' : '?')); ?> diff --git a/modules/mod_online_users.php b/modules/mod_online_users.php index efd0942..26d4fa1 100644 --- a/modules/mod_online_users.php +++ b/modules/mod_online_users.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_online_users.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_online_users.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,12 +8,12 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_online_users.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: mod_online_users.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ global $gBitUser; $online_users = $gBitUser->get_online_users(); -$smarty->assign('online_users', $online_users); -$smarty->assign('logged_users', count( $online_users ) ); +$gBitSmarty->assign('online_users', $online_users); +$gBitSmarty->assign('logged_users', count( $online_users ) ); ?> diff --git a/modules/mod_since_last_visit.php b/modules/mod_since_last_visit.php index 73f3baa..54eab44 100644 --- a/modules/mod_since_last_visit.php +++ b/modules/mod_since_last_visit.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_since_last_visit.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_since_last_visit.php,v 1.4 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,13 +8,13 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_since_last_visit.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Id: mod_since_last_visit.php,v 1.4 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ if( $gBitSystem->isPackageActive( 'bitforums' ) ) { $nvi_info = $gBitSystem->get_news_from_last_visit($user); - $smarty->assign('nvi_info', $nvi_info); + $gBitSmarty->assign('nvi_info', $nvi_info); } ?> diff --git a/modules/mod_user_bookmarks.php b/modules/mod_user_bookmarks.php index 75507c5..788b50e 100644 --- a/modules/mod_user_bookmarks.php +++ b/modules/mod_user_bookmarks.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_bookmarks.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_bookmarks.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_user_bookmarks.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Id: mod_user_bookmarks.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ @@ -27,7 +27,7 @@ if( $gBitSystem->isFeatureActive( 'feature_user_bookmarks' ) && $gBitUser->isReg } // check the session to get the parent or create parent =0 - $smarty->assign('ownurl', httpPrefix(). $_SERVER["REQUEST_URI"]); + $gBitSmarty->assign('ownurl', httpPrefix(). $_SERVER["REQUEST_URI"]); if (!isset($_SESSION["bookmarks_parent"])) { $_SESSION["bookmarks_parent"] = 0; } @@ -41,7 +41,7 @@ if( $gBitSystem->isFeatureActive( 'feature_user_bookmarks' ) && $gBitUser->isReg } else { $modb_sep = '?'; } - $smarty->assign('modb_sep', $modb_sep); + $gBitSmarty->assign('modb_sep', $modb_sep); if (isset($_REQUEST["bookmark_removeurl"])) { $bookmarklib->remove_url($_REQUEST["bookmark_removeurl"], $gBitUser->mUserId ); header( 'Location: '.$_SERVER['HTTP_REFERER'] ); @@ -67,7 +67,7 @@ if( $gBitSystem->isFeatureActive( 'feature_user_bookmarks' ) && $gBitUser->isReg $modb_father = $modb_p_info["parent_id"]; // get folders for the parent $modb_urls = $bookmarklib->list_folder($_SESSION["bookmarks_parent"], 0, -1, 'name_asc', '', $gBitUser->mUserId ); - $smarty->assign('modb_urls', $modb_urls["data"]); + $gBitSmarty->assign('modb_urls', $modb_urls["data"]); $modb_folders = $bookmarklib->get_child_folders($_SESSION["bookmarks_parent"], $gBitUser->mUserId ); $modb_pf = array( "name" => "..", @@ -79,7 +79,7 @@ if( $gBitSystem->isFeatureActive( 'feature_user_bookmarks' ) && $gBitUser->isReg if ($_SESSION["bookmarks_parent"]) { $modb_folders = array_merge($modb_pfs, $modb_folders); } - $smarty->assign('modb_folders', $modb_folders); + $gBitSmarty->assign('modb_folders', $modb_folders); // get urls for the parent } ?> diff --git a/modules/mod_user_image_galleries.php b/modules/mod_user_image_galleries.php index 2ae4870..70410ee 100644 --- a/modules/mod_user_image_galleries.php +++ b/modules/mod_user_image_galleries.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_image_galleries.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_image_galleries.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,10 +8,10 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_user_image_galleries.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Id: mod_user_image_galleries.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ $ranking = $gBitSystem->get_user_galleries($user, $module_rows); -$smarty->assign('modUserG', $ranking); +$gBitSmarty->assign('modUserG', $ranking); ?> diff --git a/modules/mod_user_pages.php b/modules/mod_user_pages.php index 54fe3af..14c4289 100644 --- a/modules/mod_user_pages.php +++ b/modules/mod_user_pages.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_user_pages.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_user_pages.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,10 +8,10 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_user_pages.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Id: mod_user_pages.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ $ranking = $gBitSystem->get_user_pages($user, $module_rows); -$smarty->assign('modUserPages', $ranking); +$gBitSmarty->assign('modUserPages', $ranking); ?> diff --git a/modules/mod_user_profile.php b/modules/mod_user_profile.php index 7cc1bf7..8668201 100644 --- a/modules/mod_user_profile.php +++ b/modules/mod_user_profile.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_user_profile.php,v 1.3 2005/06/28 07:46:24 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_user_profile.php,v 1.4 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,15 +8,15 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_user_profile.php,v 1.3 2005/06/28 07:46:24 spiderr Exp $ + * $Id: mod_user_profile.php,v 1.4 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ -global $gQueryUser, $gBitUser, $smarty; +global $gQueryUser, $gBitUser, $gBitSmarty; if( !empty( $gQueryUser->mInfo ) ) { - $smarty->assign_by_ref('userInfo', $gQueryUser->mInfo ); + $gBitSmarty->assign_by_ref('userInfo', $gQueryUser->mInfo ); } elseif( !empty( $gBitUser->mInfo ) ) { - $smarty->assign_by_ref('userInfo', $gBitUser->mInfo ); + $gBitSmarty->assign_by_ref('userInfo', $gBitUser->mInfo ); } ?> diff --git a/modules/mod_user_tasks.php b/modules/mod_user_tasks.php index 829fea9..6d14b81 100644 --- a/modules/mod_user_tasks.php +++ b/modules/mod_user_tasks.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_tasks.php,v 1.3 2005/07/25 20:02:55 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_tasks.php,v 1.4 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_user_tasks.php,v 1.3 2005/07/25 20:02:55 squareing Exp $ + * $Id: mod_user_tasks.php,v 1.4 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ @@ -39,9 +39,9 @@ if ($gBitUser->getUserId() > 0 && $gBitSystem->isFeatureActive('feature_tasks') $tasklib->replace_task($gBitUser->getUserId(), 0, $_REQUEST['modTasksTitle'], $_REQUEST['modTasksTitle'], date("U"), 'o', 3, 0, 0); } $ownurl =/*httpPrefix().*/ $_SERVER["REQUEST_URI"]; - $smarty->assign('ownurl', $ownurl); + $gBitSmarty->assign('ownurl', $ownurl); $tasks_use_dates = $gBitUser->getPreference('tasks_use_dates'); $modTasks = $tasklib->list_tasks($gBitUser->getUserId(), 0, -1, 'priority_desc', '', $tasks_use_dates, $pdate); - $smarty->assign('modTasks', $modTasks['data']); + $gBitSmarty->assign('modTasks', $modTasks['data']); } ?> diff --git a/modules/mod_user_tasks.tpl b/modules/mod_user_tasks.tpl index 0c3b0cc..07a0182 100644 --- a/modules/mod_user_tasks.tpl +++ b/modules/mod_user_tasks.tpl @@ -1,5 +1,5 @@ -{* $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_tasks.tpl,v 1.2 2005/07/17 17:36:44 squareing Exp $ *} -{if $gBitSystem->isFeatureActive( 'feature_tasks' ) and $user} +{* $Header: /cvsroot/bitweaver/_bit_users/modules/Attic/mod_user_tasks.tpl,v 1.3 2005/08/01 18:42:03 squareing Exp $ *} +{if $gBitSystem->isFeatureActive( 'feature_tasks' ) and $gBitUser->getUserId() > 0} {bitmodule title="$moduleTitle" name="user_tasks"} {form action=$ownurl} <input type="text" name="modTasksTitle" /> diff --git a/modules/mod_who_is_there.php b/modules/mod_who_is_there.php index e09a2fe..24baa24 100644 --- a/modules/mod_who_is_there.php +++ b/modules/mod_who_is_there.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_who_is_there.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/modules/mod_who_is_there.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,13 +8,13 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: mod_who_is_there.php,v 1.2 2005/06/28 07:46:24 spiderr Exp $ + * $Id: mod_who_is_there.php,v 1.3 2005/08/01 18:42:03 squareing Exp $ * @package users * @subpackage modules */ global $userlib; $logged_users = $gBitUser->count_sessions(); $online_users = $gBitUser->get_online_users(); -$smarty->assign('online_users', $online_users); -$smarty->assign('logged_users', $logged_users); +$gBitSmarty->assign('online_users', $online_users); +$gBitSmarty->assign('logged_users', $logged_users); ?> @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/my.php,v 1.6 2005/07/25 20:02:54 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/my.php,v 1.7 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: my.php,v 1.6 2005/07/25 20:02:54 squareing Exp $ + * $Id: my.php,v 1.7 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -27,18 +27,18 @@ if( !$gBitUser->isRegistered() ) { // custom userfields if( !empty( $gBitSystem->mPrefs['custom_user_fields'] ) ) { $customFields= explode( ',', $gBitSystem->mPrefs['custom_user_fields'] ); - $smarty->assign('customFields', $customFields); + $gBitSmarty->assign('customFields', $customFields); } // some content specific offsets and pagination settings if( !empty( $_REQUEST['sort_mode'] ) ) { $content_sort_mode = $_REQUEST['sort_mode']; - $smarty->assign( 'sort_mode', $content_sort_mode ); + $gBitSmarty->assign( 'sort_mode', $content_sort_mode ); } $max_content = $gBitSystem->mPrefs['maxRecords']; $offset_content = !empty( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : 0; -$smarty->assign( 'curPage', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 ); +$gBitSmarty->assign( 'curPage', $page = !empty( $_REQUEST['page'] ) ? $_REQUEST['page'] : 1 ); $offset_content = ( $page - 1 ) * $gBitSystem->mPrefs['maxRecords']; // set the user_id to only display content viewing user @@ -49,13 +49,13 @@ include_once( LIBERTY_PKG_PATH.'get_content_list_inc.php' ); // calculate page number $numPages = ceil( $contentList['cant'] / $gBitSystem->mPrefs['maxRecords'] ); -$smarty->assign( 'numPages', $numPages ); +$gBitSmarty->assign( 'numPages', $numPages ); -//$smarty->assign_by_ref('offset', $offset); -$smarty->assign( 'contentSelect', $contentSelect ); -$smarty->assign( 'contentTypes', $contentTypes ); -$smarty->assign( 'contentList', $contentList['data'] ); -$smarty->assign( 'contentCount', $contentList['cant'] ); +//$gBitSmarty->assign_by_ref('offset', $offset); +$gBitSmarty->assign( 'contentSelect', $contentSelect ); +$gBitSmarty->assign( 'contentTypes', $contentTypes ); +$gBitSmarty->assign( 'contentList', $contentList['data'] ); +$gBitSmarty->assign( 'contentCount', $contentList['cant'] ); // end of content listing $gBitSystem->display( 'bitpackage:users/my_bitweaver.tpl', 'My '.$gBitSystem->getPreference( 'siteTitle' ) ); @@ -67,7 +67,7 @@ $gBitSystem->display( 'bitpackage:users/my_bitweaver.tpl', 'My '.$gBitSystem->ge /* // User preferences screen if ($feature_userPreferences != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_userPreferences"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_userPreferences"); $gBitSystem->display( 'error.tpl' ); die; } @@ -77,8 +77,8 @@ if ($feature_userPreferences != 'y') { $foo = parse_url($_SERVER["REQUEST_URI"]); $foo1 = str_replace( USERS_PKG_URL."user_preferences", WIKI_PKG_URL."edit", $foo["path"]); $foo2 = str_replace( USERS_PKG_URL."user_preferences", WIKI_PKG_URL."index", $foo["path"]); -$smarty->assign('url_edit', httpPrefix(). $foo1); -$smarty->assign('url_visit', httpPrefix(). $foo2); +$gBitSmarty->assign('url_edit', httpPrefix(). $foo1); +$gBitSmarty->assign('url_visit', httpPrefix(). $foo2); */ /* none of this is being used in the my_bitweaver.tpl file - xing if (isset($_REQUEST['messprefs'])) { @@ -102,15 +102,15 @@ if (isset($_REQUEST['tasksprefs'])) { } $tasks_maxRecords = $gBitUser->getPreference('tasks_maxRecords'); $tasks_use_dates = $gBitUser->getPreference('tasks_use_dates'); -$smarty->assign('tasks_maxRecords', $tasks_maxRecords); -$smarty->assign('tasks_use_dates', $tasks_use_dates); +$gBitSmarty->assign('tasks_maxRecords', $tasks_maxRecords); +$gBitSmarty->assign('tasks_use_dates', $tasks_use_dates); $mess_maxRecords = $gBitUser->getPreference('mess_maxRecords', 20); -$smarty->assign('mess_maxRecords', $mess_maxRecords); +$gBitSmarty->assign('mess_maxRecords', $mess_maxRecords); $allowMsgs = $gBitUser->getPreference('allowMsgs', 'y'); -$smarty->assign('allowMsgs', $allowMsgs); +$gBitSmarty->assign('allowMsgs', $allowMsgs); $minPrio = $gBitUser->getPreference('minPrio', 6); -$smarty->assign('minPrio', $minPrio); -$smarty->assign_by_ref('userinfo', $gBitUser->mInfo); +$gBitSmarty->assign('minPrio', $minPrio); +$gBitSmarty->assign_by_ref('userinfo', $gBitUser->mInfo); $styles = array(); $h = opendir( THEMES_PKG_PATH.'styles/' ); while ($file = readdir($h)) { @@ -119,7 +119,7 @@ while ($file = readdir($h)) { } } closedir ($h); -$smarty->assign_by_ref('styles', $styles); +$gBitSmarty->assign_by_ref('styles', $styles); $languages = array(); $h = opendir( LANGUAGES_PKG_PATH.'lang/' ); while ($file = readdir($h)) { @@ -128,7 +128,7 @@ while ($file = readdir($h)) { } } closedir ($h); -$smarty->assign_by_ref('languages', $languages); +$gBitSmarty->assign_by_ref('languages', $languages); // Get user pages if (isset($_REQUEST["by"]) && ($_REQUEST["by"]=='creator')) $who = 'creator'; */ @@ -136,26 +136,26 @@ if (isset($_REQUEST["by"]) && ($_REQUEST["by"]=='creator')) $who = 'creator'; if( $gBitSystem->isPackageActive( 'blogs' ) ) { require_once( BLOGS_PKG_PATH.'BitBlog.php' ); $user_blogs = $gBlog->list_user_blogs($userwatch,false); - $smarty->assign_by_ref('user_blogs', $user_blogs); + $gBitSmarty->assign_by_ref('user_blogs', $user_blogs); } if( $gBitSystem->isPackageActive( 'wiki') && !empty( $userwatchId ) ) { require_once( WIKI_PKG_PATH.'BitPage.php' ); global $wikilib; $user_pages = $wikilib->get_user_pages( $userwatchId, -1 ); - $smarty->assign_by_ref('user_pages', $user_pages); + $gBitSmarty->assign_by_ref('user_pages', $user_pages); } if( $gBitSystem->isPackageActive( 'imagegals' ) ) { $user_galleries = $gBitSystem->get_user_galleries($userwatch, -1); - $smarty->assign_by_ref('user_galleries', $user_galleries); + $gBitSmarty->assign_by_ref('user_galleries', $user_galleries); } if( $gBitSystem->isPackageActive( 'trackers' ) ) { $user_items = $gBitSystem->get_user_items($userwatch); - $smarty->assign_by_ref('user_items', $user_items); + $gBitSmarty->assign_by_ref('user_items', $user_items); } if( $gBitSystem->isPackageActive( 'messu' ) ) { require_once( MESSU_PKG_PATH.'messu_lib.php' ); $msgs = $messulib->list_user_messages($user, 0, -1, 'date_desc', '', 'is_read', 'n'); - $smarty->assign('msgs', $msgs['data']); + $gBitSmarty->assign('msgs', $msgs['data']); } */ // Get flags here @@ -169,18 +169,18 @@ while ($file = readdir($h)) { } } closedir ($h); -$smarty->assign('flags', $flags); +$gBitSmarty->assign('flags', $flags); // Get preferences $gBitLanguage->mLanguage = $gBitUser->getPreference('bitlanguage', $gBitLanguage->mLanguage); $real_name = $gBitUser->getPreference('real_name', ''); $country = $gBitUser->getPreference('country', 'Other'); -$smarty->assign('country', $country); +$gBitSmarty->assign('country', $country); $anonpref = $gBitUser->getPreference('userbreadCrumb', 4); $userbreadCrumb = $gBitUser->getPreference('userbreadCrumb', $anonpref); -$smarty->assign_by_ref('real_name', $real_name); -$smarty->assign_by_ref('userbreadCrumb', $userbreadCrumb); +$gBitSmarty->assign_by_ref('real_name', $real_name); +$gBitSmarty->assign_by_ref('userbreadCrumb', $userbreadCrumb); $homePage = $gBitUser->getPreference('homePage', ''); -$smarty->assign_by_ref('homePage', $homePage); +$gBitSmarty->assign_by_ref('homePage', $homePage); //Get tasks if (isset($_SESSION['thedate'])) { $pdate = $_SESSION['thedate']; @@ -189,20 +189,20 @@ if (isset($_SESSION['thedate'])) { } $tasks_use_dates = $gBitUser->getPreference('tasks_use_dates'); $tasks = $tasklib->list_tasks($gBitUser->mUserId, 0, -1, 'priority_desc', '', $tasks_use_dates, $pdate); -$smarty->assign('tasks', $tasks['data']); +$gBitSmarty->assign('tasks', $tasks['data']); $user_information = $gBitUser->getPreference('user_information', 'public'); -$smarty->assign('user_information', $user_information); +$gBitSmarty->assign('user_information', $user_information); $timezone_options = $gBitSystem->get_timezone_list(true); -$smarty->assign_by_ref('timezone_options', $timezone_options); +$gBitSmarty->assign_by_ref('timezone_options', $timezone_options); $server_time = new Date(); $display_timezone = $gBitUser->getPreference('display_timezone', $server_time->tz->getID()); -$smarty->assign_by_ref('display_timezone', $display_timezone); -$smarty->assign('mybitweaver_pages', $gBitUser->getPreference('mybitweaver_pages'), 'y'); -$smarty->assign('mybitweaver_blogs', $gBitUser->getPreference('mybitweaver_blogs'), 'y'); -$smarty->assign('mybitweaver_gals', $gBitUser->getPreference('mybitweaver_gals'), 'y'); -$smarty->assign('mybitweaver_items', $gBitUser->getPreference('mybitweaver_items'), 'y'); -$smarty->assign('mybitweaver_msgs', $gBitUser->getPreference('mybitweaver_msgs'), 'y'); -$smarty->assign('mybitweaver_tasks', $gBitUser->getPreference('mybitweaver_tasks'), 'y'); +$gBitSmarty->assign_by_ref('display_timezone', $display_timezone); +$gBitSmarty->assign('mybitweaver_pages', $gBitUser->getPreference('mybitweaver_pages'), 'y'); +$gBitSmarty->assign('mybitweaver_blogs', $gBitUser->getPreference('mybitweaver_blogs'), 'y'); +$gBitSmarty->assign('mybitweaver_gals', $gBitUser->getPreference('mybitweaver_gals'), 'y'); +$gBitSmarty->assign('mybitweaver_items', $gBitUser->getPreference('mybitweaver_items'), 'y'); +$gBitSmarty->assign('mybitweaver_msgs', $gBitUser->getPreference('mybitweaver_msgs'), 'y'); +$gBitSmarty->assign('mybitweaver_tasks', $gBitUser->getPreference('mybitweaver_tasks'), 'y'); $section = 'mybitweaver'; include_once ( KERNEL_PKG_PATH.'menu_register_inc.php' ); diff --git a/my_files.php b/my_files.php index cd17fee..49ebd9f 100644 --- a/my_files.php +++ b/my_files.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/Attic/my_files.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/Attic/my_files.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: my_files.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: my_files.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -20,15 +20,15 @@ require_once("../bit_setup_inc.php"); global $gBitSystem; if (!$gBitUser->mUserId) { - $smarty->assign('msg', tra("You are not logged in")); + $gBitSmarty->assign('msg', tra("You are not logged in")); $gBitSystem->display( 'error.tpl' ); die; } $userFiles = $gBitUser->getUserFiles(); -$smarty->assign_by_ref('userFiles', $userFiles['files']); -$smarty->assign('numUserFiles', count($userFiles['files'])); -$smarty->assign('diskUsage', $userFiles['diskUsage']); +$gBitSmarty->assign_by_ref('userFiles', $userFiles['files']); +$gBitSmarty->assign('numUserFiles', count($userFiles['files'])); +$gBitSmarty->assign('diskUsage', $userFiles['diskUsage']); if (!empty($_REQUEST['deleteAttachment'])) { $attachmentId = $_REQUEST['deleteAttachment']; diff --git a/my_groups.php b/my_groups.php index 9749499..010ce07 100644 --- a/my_groups.php +++ b/my_groups.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/my_groups.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/my_groups.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: my_groups.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: my_groups.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -42,7 +42,7 @@ if( !empty( $_REQUEST['group_id'] ) ) { $groupList = $gBitUser->getAllGroups( $listHash ); } -$smarty->assign( 'package',isset( $_REQUEST['package'] ) ? $_REQUEST['package'] : 'all' ); +$gBitSmarty->assign( 'package',isset( $_REQUEST['package'] ) ? $_REQUEST['package'] : 'all' ); if( !empty( $_REQUEST["cancel"] ) ) { header( 'Location: '.USERS_PKG_URL.'my_groups.php' ); @@ -105,7 +105,7 @@ if( !empty( $_REQUEST["cancel"] ) ) { $searchParams = array('find' => $_REQUEST['find']); $gBitUser->getList($searchParams); $foundUsers = $searchParams['data']; - $smarty->assign_by_ref('foundUsers', $foundUsers); + $gBitSmarty->assign_by_ref('foundUsers', $foundUsers); } elseif (!empty($_REQUEST['assignuser'])) { if( !empty($_REQUEST['group_id'] ) ) { // need some security here people! @@ -137,11 +137,11 @@ if( empty( $groupList ) ) { } $levels = $gBitUser->get_permission_levels(); sort($levels); - $smarty->assign('levels', $levels); + $gBitSmarty->assign('levels', $levels); $groupUsers = $gBitUser->get_group_users( $_REQUEST['group_id'] ); - $smarty->assign_by_ref('groupUsers', $groupUsers); - $smarty->assign_by_ref('groupInfo', $groupInfo); - $smarty->assign_by_ref( 'allPerms', $allPerms ); + $gBitSmarty->assign_by_ref('groupUsers', $groupUsers); + $gBitSmarty->assign_by_ref('groupInfo', $groupInfo); + $gBitSmarty->assign_by_ref( 'allPerms', $allPerms ); $gBitSystem->setBrowserTitle( 'Admininster Group: '.$groupInfo['group_name'].' '.(isset( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : '') ); $mid = 'bitpackage:users/my_group_edit.tpl'; } else { @@ -150,11 +150,11 @@ if( empty( $groupList ) ) { $mid = 'bitpackage:users/my_groups_list.tpl'; } } - $smarty->assign('groups', $groupList); + $gBitSmarty->assign('groups', $groupList); } -$smarty->assign('successMsg',$successMsg); -$smarty->assign('errorMsg',$errorMsg); -$smarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'edit').'TabSelect', 'tdefault' ); +$gBitSmarty->assign('successMsg',$successMsg); +$gBitSmarty->assign('errorMsg',$errorMsg); +$gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'edit').'TabSelect', 'tdefault' ); // Display the template for group administration diff --git a/my_images.php b/my_images.php index 99b7573..a10e772 100644 --- a/my_images.php +++ b/my_images.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/my_images.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/my_images.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: my_images.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: my_images.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -22,12 +22,12 @@ require_once( '../bit_setup_inc.php' ); // User preferences screen if ($feature_userPreferences != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_userPreferences"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_userPreferences"); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->isValid()) { - $smarty->assign('msg', tra("You are not logged in")); + $gBitSmarty->assign('msg', tra("You are not logged in")); $gBitSystem->display( 'error.tpl' ); die; } @@ -39,14 +39,14 @@ if (!isset($_REQUEST["showall"])) { include_once(USERS_PKG_PATH.'lookup_user_inc.php'); if ($gQueryUser->mUserId != $gBitUser->mUserId && !$gBitUser->object_has_permission($gBitUser->mUserId, $gQueryUser->mInfo['content_id'], 'bituser', 'bit_p_admin_user')) { - $smarty->assign('msg', tra('You do not have permission to edit this user\'s images')); + $gBitSmarty->assign('msg', tra('You do not have permission to edit this user\'s images')); $gBitSystem->display('error.tpl'); die; } -$smarty->assign('showall', $_REQUEST["showall"]); +$gBitSmarty->assign('showall', $_REQUEST["showall"]); $userwatch = $gQueryUser->mUsername; -$smarty->assign('userwatch', $userwatch); +$gBitSmarty->assign('userwatch', $userwatch); $_REQUEST["user_id"]=$gQueryUser->mUserId; // Upload avatar is processed here @@ -72,7 +72,7 @@ if (isset($_REQUEST["uselib"])) { // For some reason, we have to reassign here to make our changes to gBitUser->mInfo present in smarty. // dunno why, but this fixes the bug. XOXO spiderr -$smarty->assign_by_ref('gQueryUser', $gQueryUser); +$gBitSmarty->assign_by_ref('gQueryUser', $gQueryUser); $gBitSystem->display( 'bitpackage:users/my_images.tpl'); diff --git a/preferences.php b/preferences.php index bf76c5d..683158c 100644 --- a/preferences.php +++ b/preferences.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/preferences.php,v 1.3 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/preferences.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: preferences.php,v 1.3 2005/06/28 07:46:23 spiderr Exp $ + * $Id: preferences.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -26,12 +26,12 @@ if( $gBitSystem->isPackageActive( 'blogs' ) ) { } // User preferences screen if ($feature_userPreferences != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_userPreferences"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_userPreferences"); $gBitSystem->display( 'error.tpl' ); die; } if (empty($gBitUser->mUserId)) { - $smarty->assign('msg', tra("You are not logged in")); + $gBitSmarty->assign('msg', tra("You are not logged in")); $gBitSystem->display( 'error.tpl' ); die; } @@ -39,7 +39,7 @@ if( !empty( $_REQUEST["view_user"] ) && $_REQUEST["view_user"] <> $gBitUser->mUs $gBitSystem->verifyPermission( 'bit_p_admin_users' ); $editUser = new BitUser( $_REQUEST["view_user"] ); $editUser->load( TRUE ); - $smarty->assign('view_user', $_REQUEST["view_user"]); + $gBitSmarty->assign('view_user', $_REQUEST["view_user"]); } else { $editUser = &$gBitUser; } @@ -50,16 +50,16 @@ $foo = parse_url($_SERVER["REQUEST_URI"]); if( $gBitSystem->isPackageActive( 'wiki' ) ) { $foo1 = str_replace( USERS_PKG_URL."user_preferences", WIKI_PKG_URL."edit", $foo["path"] ); $foo2 = str_replace( USERS_PKG_URL."user_preferences", WIKI_PKG_URL."index", $foo["path"] ); - $smarty->assign('url_edit', httpPrefix(). $foo1); - $smarty->assign('url_visit', httpPrefix(). $foo2); + $gBitSmarty->assign('url_edit', httpPrefix(). $foo1); + $gBitSmarty->assign('url_visit', httpPrefix(). $foo2); } if( !empty( $gBitSystem->mPrefs['custom_user_fields'] ) ) { $customFields= explode( ',', $gBitSystem->mPrefs['custom_user_fields'] ); - $smarty->assign('customFields', $customFields); + $gBitSmarty->assign('customFields', $customFields); } $gBitLanguage->mLanguage = $editUser->getPreference( 'bitlanguage', $gBitLanguage->mLanguage); -$smarty->assign( 'gBitLanguage', $gBitLanguage ); +$gBitSmarty->assign( 'gBitLanguage', $gBitLanguage ); if (isset($_REQUEST["prefs"])) { // setting preferences // if (isset($_REQUEST["email"])) $gBitUser->change_user_email($userwatch,$_REQUEST["email"]); @@ -75,19 +75,19 @@ if (isset($_REQUEST["prefs"])) { } } if (isset($_REQUEST["style"])) - $smarty->assign('style', $_REQUEST["style"]); + $gBitSmarty->assign('style', $_REQUEST["style"]); if (isset($_REQUEST['display_timezone'])) { $editUser->storePreference( 'display_timezone', $_REQUEST['display_timezone']); - $smarty->assign_by_ref('display_timezone', $_REQUEST['display_timezone']); + $gBitSmarty->assign_by_ref('display_timezone', $_REQUEST['display_timezone']); } $editUser->storePreference( 'country', $_REQUEST["country"]); $editUser->storePreference( 'user_information', $_REQUEST['user_information']); if (isset($_REQUEST['user_dbl']) && $_REQUEST['user_dbl'] == 'on') { $editUser->storePreference( 'user_dbl', 'y'); - $smarty->assign('user_dbl', 'y'); + $gBitSmarty->assign('user_dbl', 'y'); } else { $editUser->storePreference( 'user_dbl', 'n'); - $smarty->assign('user_dbl', 'n'); + $gBitSmarty->assign('user_dbl', 'n'); } if( isset( $customFields ) && is_array( $customFields ) ) { foreach( $customFields as $f ) { @@ -110,12 +110,12 @@ if (isset($_REQUEST['chgemail'])) { // check user's password if (!$editUser->validate($editUser->mUsername, $_REQUEST['pass'], '', '')) { - $smarty->assign('msg', tra("Invalid password. You current password is required to change your email address.")); + $gBitSmarty->assign('msg', tra("Invalid password. You current password is required to change your email address.")); $gBitSystem->display( 'error.tpl' ); die; } if( $editUser->change_user_email( $editUser->mUserId, $editUser->mUsername, $_REQUEST['email'], $_REQUEST['pass'] ) ) { - $smarty->assign( 'successMsg', tra( 'Your email address was updated successfully' ) ); + $gBitSmarty->assign( 'successMsg', tra( 'Your email address was updated successfully' ) ); } } if (isset($_REQUEST["chgpswd"])) { @@ -137,7 +137,7 @@ if (isset($_REQUEST["chgpswd"])) { } } if( $gBitUser->change_user_password($editUser->mUsername, $_REQUEST["pass1"]) ) { - $smarty->assign( 'successMsg', tra( 'The password was updated successfully' ) ); + $gBitSmarty->assign( 'successMsg', tra( 'The password was updated successfully' ) ); } } if (isset($_REQUEST['messprefs'])) { @@ -194,43 +194,43 @@ if (isset($_REQUEST['tasksprefs'])) { } $tasks_use_dates = $editUser->getPreference( 'tasks_use_dates'); -$smarty->assign('tasks_maxRecords', $tasks_maxRecords); -$smarty->assign('tasks_use_dates', $tasks_use_dates); +$gBitSmarty->assign('tasks_maxRecords', $tasks_maxRecords); +$gBitSmarty->assign('tasks_use_dates', $tasks_use_dates); $mess_maxRecords = $editUser->getPreference( 'mess_maxRecords', 20); -$smarty->assign('mess_maxRecords', $mess_maxRecords); +$gBitSmarty->assign('mess_maxRecords', $mess_maxRecords); $allowMsgs = $editUser->getPreference( 'allowMsgs', 'y'); -$smarty->assign('allowMsgs', $allowMsgs); +$gBitSmarty->assign('allowMsgs', $allowMsgs); $minPrio = $editUser->getPreference( 'minPrio', 3 ); -$smarty->assign('minPrio', $minPrio); -$smarty->assign_by_ref('userInfo', $editUser->mInfo ); -$smarty->assign_by_ref('userPrefs', $editUser->mUserPrefs ); +$gBitSmarty->assign('minPrio', $minPrio); +$gBitSmarty->assign_by_ref('userInfo', $editUser->mInfo ); +$gBitSmarty->assign_by_ref('userPrefs', $editUser->mUserPrefs ); $languages = array(); $languages = $gBitLanguage->listLanguages(); -$smarty->assign_by_ref('languages', $languages); +$gBitSmarty->assign_by_ref('languages', $languages); // Get user pages if( $gBitSystem->isPackageActive( 'messu' ) ) { - $smarty->assign('mybitweaver_msgs', $editUser->getPreference( 'mybitweaver_msgs'), 'y'); + $gBitSmarty->assign('mybitweaver_msgs', $editUser->getPreference( 'mybitweaver_msgs'), 'y'); } if( $gBitSystem->isPackageActive( 'wiki' ) ) { - $smarty->assign('mybitweaver_pages', $editUser->getPreference( 'mybitweaver_pages'), 'y'); + $gBitSmarty->assign('mybitweaver_pages', $editUser->getPreference( 'mybitweaver_pages'), 'y'); $user_pages = $wikilib->get_user_pages($editUser->mUserId, -1); - $smarty->assign_by_ref('user_pages', $user_pages); + $gBitSmarty->assign_by_ref('user_pages', $user_pages); } if( $gBitSystem->isPackageActive( 'blogs' ) ) { - $smarty->assign('mybitweaver_blogs', $editUser->getPreference( 'mybitweaver_blogs'), 'y'); + $gBitSmarty->assign('mybitweaver_blogs', $editUser->getPreference( 'mybitweaver_blogs'), 'y'); $user_blogs = $gBlog->list_user_blogs($editUser->mUserId, false); - $smarty->assign_by_ref('user_blogs', $user_blogs); + $gBitSmarty->assign_by_ref('user_blogs', $user_blogs); } if( $gBitSystem->isPackageActive( 'imagegals' ) ) { - $smarty->assign('mybitweaver_gals', $editUser->getPreference( 'mybitweaver_gals'), 'y'); + $gBitSmarty->assign('mybitweaver_gals', $editUser->getPreference( 'mybitweaver_gals'), 'y'); $user_galleries = $gBitSystem->get_user_galleries($editUser->mUsername, -1); - $smarty->assign_by_ref('user_galleries', $user_galleries); + $gBitSmarty->assign_by_ref('user_galleries', $user_galleries); } if( $gBitSystem->isPackageActive( 'trackers' ) ) { - $smarty->assign('mybitweaver_items', $editUser->getPreference( 'mybitweaver_items'), 'y'); + $gBitSmarty->assign('mybitweaver_items', $editUser->getPreference( 'mybitweaver_items'), 'y'); $user_items = $gBitSystem->get_user_items($editUser->mUsername); - $smarty->assign_by_ref('user_items', $user_items); - $smarty->assign('mybitweaver_tasks', $editUser->getPreference( 'mybitweaver_tasks'), 'y'); + $gBitSmarty->assign_by_ref('user_items', $user_items); + $gBitSmarty->assign('mybitweaver_tasks', $editUser->getPreference( 'mybitweaver_tasks'), 'y'); } // Get flags here @@ -248,31 +248,31 @@ sort ($flags); $editUser->mInfo['userbreadCrumb'] = $editUser->getPreference( 'userbreadCrumb', $gBitSystem->getPreference('userbreadCrumb', 4) ); $editUser->mInfo['homePage'] = $editUser->getPreference( 'homePage', ''); -$smarty->assign('flags', $flags); -$smarty->assign( 'editUser', $editUser->mInfo ); +$gBitSmarty->assign('flags', $flags); +$gBitSmarty->assign( 'editUser', $editUser->mInfo ); // Get preferences //SPIDERKILL $style = $editUser->getPreference( 'theme', $style); -//SPIDERKILL $smarty->assign_by_ref('style', $style); +//SPIDERKILL $gBitSmarty->assign_by_ref('style', $style); $real_name = $editUser->mInfo["real_name"]; $country = $editUser->getPreference( 'country', 'Other'); -$smarty->assign('country', $country); -$smarty->assign('email_isPublic', $editUser->getPreference( 'email is public', 'n')); +$gBitSmarty->assign('country', $country); +$gBitSmarty->assign('email_isPublic', $editUser->getPreference( 'email is public', 'n')); $scramblingMethods = array("n", "strtr", "unicode", "x"); // email_isPublic utilizes 'n' -$smarty->assign_by_ref('scramblingMethods', $scramblingMethods); +$gBitSmarty->assign_by_ref('scramblingMethods', $scramblingMethods); $scramblingEmails = array(tra("no"), scrambleEmail($editUser->mInfo['email'], 'strtr'), scrambleEmail($editUser->mInfo['email'], 'unicode')."-".tra("unicode"), scrambleEmail($editUser->mInfo['email'], 'x')); -$smarty->assign_by_ref('scramblingEmails', $scramblingEmails); +$gBitSmarty->assign_by_ref('scramblingEmails', $scramblingEmails); $user_information = $editUser->getPreference( 'user_information', 'public'); -$smarty->assign('user_information', $user_information); +$gBitSmarty->assign('user_information', $user_information); $user_dbl = $editUser->getPreference( 'user_dbl', 'y'); -$smarty->assign('user_dbl', $user_dbl); +$gBitSmarty->assign('user_dbl', $user_dbl); //$timezone_options = $gBitSystem->get_timezone_list(true); -//$smarty->assign_by_ref('timezone_options',$timezone_options); +//$gBitSmarty->assign_by_ref('timezone_options',$timezone_options); //$server_time = new Date(); $display_timezone = $editUser->getPreference( 'display_timezone', "UTC"); if ($display_timezone != "UTC") $display_timezone = "Local"; -$smarty->assign_by_ref('display_timezone', $display_timezone); +$gBitSmarty->assign_by_ref('display_timezone', $display_timezone); $gBitSystem->display( 'bitpackage:users/user_preferences.tpl', 'Edit User Preferences'); ?> diff --git a/register.php b/register.php index 797f85e..bf4f505 100644 --- a/register.php +++ b/register.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/register.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/register.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: register.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Id: register.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -44,26 +44,26 @@ if( isset( $_REQUEST["register"] ) ) { $newUser = new BitPermUser(); if( $newUser->register( $reg ) ) { if( $gBitSystem->isFeatureActive( 'validateUsers' ) ) { - $smarty->assign('msg',tra('You will receive an email with information to login for the first time into this site')); - $smarty->assign('showmsg','y'); + $gBitSmarty->assign('msg',tra('You will receive an email with information to login for the first time into this site')); + $gBitSmarty->assign('showmsg','y'); } else { $url = $newUser->login( $reg['login'], $reg['password'], FALSE, FALSE ); header( 'Location: '.$url ); exit; } } else { - $smarty->assign_by_ref( 'errors', $newUser->mErrors ); + $gBitSmarty->assign_by_ref( 'errors', $newUser->mErrors ); } } else { - $smarty->assign_by_ref( 'errors', $errors ); + $gBitSmarty->assign_by_ref( 'errors', $errors ); } - $smarty->assign_by_ref( 'reg', $reg ); + $gBitSmarty->assign_by_ref( 'reg', $reg ); } else { if( !empty( $gBitSystem->mPrefs['custom_user_fields'] ) ) { $fields= explode( ',', $gBitSystem->mPrefs['custom_user_fields'] ); trim_array( $fields ); - $smarty->assign('customFields', $fields); + $gBitSmarty->assign('customFields', $fields); } } diff --git a/remind_password.php b/remind_password.php index 7b8cbb9..7eef22b 100644 --- a/remind_password.php +++ b/remind_password.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/remind_password.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/remind_password.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: remind_password.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Id: remind_password.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -18,7 +18,7 @@ */ require_once( '../bit_setup_inc.php' ); if ($forgotPass != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": forgotPass"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": forgotPass"); $gBitSystem->display( 'error.tpl' ); die; } elseif( $gBitUser->isRegistered() ) { @@ -35,20 +35,20 @@ if ($forgotPass != 'y') { } $tmp['success'] .= tra("to the registered email address for")." " . $_REQUEST["username"] . "."; - $smarty->assign('mail_site', $_SERVER["SERVER_NAME"]); - $smarty->assign('mail_user', $_REQUEST["username"]); - $smarty->assign('mail_same', $gBitSystem->isFeatureActive( 'feature_clear_passwords' )); - $smarty->assign('mail_pass', $pass); - $mail_data = $smarty->fetch('bitpackage:users/password_reminder.tpl'); + $gBitSmarty->assign('mail_site', $_SERVER["SERVER_NAME"]); + $gBitSmarty->assign('mail_user', $_REQUEST["username"]); + $gBitSmarty->assign('mail_same', $gBitSystem->isFeatureActive( 'feature_clear_passwords' )); + $gBitSmarty->assign('mail_pass', $pass); + $mail_data = $gBitSmarty->fetch('bitpackage:users/password_reminder.tpl'); $subject = "Your password for ".$gBitSystem->getPreference( 'siteTitle', $_SERVER['HTTP_HOST'] ); mail( $userInfo['email'], $subject, $mail_data, "From: ".$gBitSystem->getPreference( 'sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n"); // Just show "success" message and no form } else { // Show error message (and leave form visible so user can fix problem) - $smarty->assign('showmsg', 'e'); + $gBitSmarty->assign('showmsg', 'e'); $tmp['error'] = tra("Invalid or unknown username").": ".$_REQUEST["username"]; } - $smarty->assign('msg', $tmp); + $gBitSmarty->assign('msg', $tmp); } // Display the template $gBitSystem->display( 'bitpackage:users/remind_password.tpl'); @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/Attic/tasks.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/Attic/tasks.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: tasks.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: tasks.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,17 +19,17 @@ require_once( '../bit_setup_inc.php' ); include_once( USERS_PKG_PATH.'task_lib.php' ); if ($feature_tasks != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_tasks"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_tasks"); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->mUserId) { - $smarty->assign('msg', tra("Must be logged to use this feature")); + $gBitSmarty->assign('msg', tra("Must be logged to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->hasPermission( 'bit_p_tasks' )) { - $smarty->assign('msg', tra("Permission denied to use this feature")); + $gBitSmarty->assign('msg', tra("Permission denied to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } @@ -39,8 +39,8 @@ for ($i = 0; $i < 101; $i += 10) { $comp_array[] = $i; $comp_array_p[] = $i . '%'; } -$smarty->assign('comp_array', $comp_array); -$smarty->assign('comp_array_p', $comp_array_p); +$gBitSmarty->assign('comp_array', $comp_array); +$gBitSmarty->assign('comp_array_p', $comp_array_p); if (!isset($_REQUEST["task_id"])) $_REQUEST["task_id"] = 0; if (isset($_REQUEST["complete"]) && isset($_REQUEST["task"])) { @@ -74,8 +74,8 @@ if (isset($_REQUEST["tasks_use_dates"])) { } $tasks_maxRecords = $gBitUser->getPreference('tasks_maxRecords', $maxRecords); $maxRecords = $tasks_maxRecords; -$smarty->assign('tasks_use_dates', $tasks_use_dates); -$smarty->assign('tasks_maxRecords', $tasks_maxRecords); +$gBitSmarty->assign('tasks_use_dates', $tasks_use_dates); +$gBitSmarty->assign('tasks_maxRecords', $tasks_maxRecords); if ($_REQUEST["task_id"]) { $info = $tasklib->get_task($gBitUser->mUserId, $_REQUEST["task_id"]); } else { @@ -111,11 +111,11 @@ if (isset($_REQUEST['save'])) { $info['date'] = date("U"); $_REQUEST["task_id"] = 0; } -$smarty->assign('task_id', $_REQUEST["task_id"]); -$smarty->assign('info', $info); -$smarty->assign('Date_Month', date("m", $info['date'])); -$smarty->assign('Date_Day', date("d", $info['date'])); -$smarty->assign('Date_Year', date("Y", $info['date'])); +$gBitSmarty->assign('task_id', $_REQUEST["task_id"]); +$gBitSmarty->assign('info', $info); +$gBitSmarty->assign('Date_Month', date("m", $info['date'])); +$gBitSmarty->assign('Date_Day', date("d", $info['date'])); +$gBitSmarty->assign('Date_Year', date("Y", $info['date'])); if ( empty( $_REQUEST["sort_mode"] ) ) { $sort_mode = 'priority_desc'; } else { @@ -130,14 +130,14 @@ if (isset($_REQUEST['page'])) { $page = &$_REQUEST['page']; $offset = ($page - 1) * $maxRecords; } -$smarty->assign_by_ref('offset', $offset); +$gBitSmarty->assign_by_ref('offset', $offset); if (isset($_REQUEST["find"])) { $find = $_REQUEST["find"]; } else { $find = ''; } -$smarty->assign('find', $find); -$smarty->assign_by_ref('sort_mode', $sort_mode); +$gBitSmarty->assign('find', $find); +$gBitSmarty->assign_by_ref('sort_mode', $sort_mode); if (isset($_SESSION['thedate'])) { $pdate = $_SESSION['thedate']; } else { @@ -146,30 +146,30 @@ if (isset($_SESSION['thedate'])) { $channels = $tasklib->list_tasks($gBitUser->mUserId, $offset, $maxRecords, $sort_mode, $find, $tasks_use_dates, $pdate); if($maxRecords == 0) { $cant_pages = 0; - $smarty->assign('actual_page', '1'); + $gBitSmarty->assign('actual_page', '1'); } else { $cant_pages = ceil($channels["cant"] / $maxRecords); - $smarty->assign('actual_page', 1 + ($offset / $maxRecords)); + $gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); } -$smarty->assign_by_ref('cant_pages', $cant_pages); +$gBitSmarty->assign_by_ref('cant_pages', $cant_pages); if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); + $gBitSmarty->assign('next_offset', $offset + $maxRecords); } else { - $smarty->assign('next_offset', -1); + $gBitSmarty->assign('next_offset', -1); } // If offset is > 0 then prev_offset if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); + $gBitSmarty->assign('prev_offset', $offset - $maxRecords); } else { - $smarty->assign('prev_offset', -1); + $gBitSmarty->assign('prev_offset', -1); } -$smarty->assign_by_ref('channels', $channels["data"]); -$smarty->assign('tasks_use_dates', $tasks_use_dates); +$gBitSmarty->assign_by_ref('channels', $channels["data"]); +$gBitSmarty->assign('tasks_use_dates', $tasks_use_dates); $percs = array(); for ($i = 0; $i <= 100; $i += 10) { $percs[] = $i; } -$smarty->assign_by_ref('percs', $percs); +$gBitSmarty->assign_by_ref('percs', $percs); $gBitSystem->display( 'bitpackage:users/user_tasks.tpl'); ?> diff --git a/templates/center_user_wiki_page.php b/templates/center_user_wiki_page.php index d535697..b4eebea 100644 --- a/templates/center_user_wiki_page.php +++ b/templates/center_user_wiki_page.php @@ -6,6 +6,6 @@ global $wikilib, $user, $gQueryUser; include_once( USERS_PKG_PATH.'lookup_user_inc.php' ); -$smarty->assign_by_ref( 'parsed', $gQueryUser->parseData() ); +$gBitSmarty->assign_by_ref( 'parsed', $gQueryUser->parseData() ); ?> diff --git a/templates/users_list.tpl b/templates/users_list.tpl index 7cf3a00..67b57f0 100644 --- a/templates/users_list.tpl +++ b/templates/users_list.tpl @@ -36,7 +36,7 @@ {if $users[user].thumbnail_url} <img alt="{tr}user portrait{/tr}" title="{$users[user].login} {tr}user portrait{/tr}" src="{$users[user].thumbnail_url}" class="thumb" /> {/if} - {if $gBitUser->hasPermission( 'bit_p_admin_users' )}{$users[user].email} ({tr}User ID{/tr}: {$users[user].user_id})<br/>{/if} + {if $gBitUser->hasPermission( 'bit_p_admin_users' )}{mailto address=$users[user].email encode="javascript"} ({tr}User ID{/tr}: {$users[user].user_id})<br/>{/if} {tr}Member since{/tr}: {$users[user].registration_date|bit_short_date}<br/> {if $users[user].current_login }{tr}Last seen{/tr}: {$users[user].current_login|bit_short_date}<br/>{/if} <div class="clear"></div> @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/theme.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/theme.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: theme.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: theme.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -28,7 +28,7 @@ global $gBitUser; global $gBitSystem; if (!$gBitUser->isRegistered()) { - $smarty->assign('msg', tra("Permission denied: You are not logged in")); + $gBitSmarty->assign('msg', tra("Permission denied: You are not logged in")); $gBitSystem->display( 'error.tpl' ); die; } @@ -36,7 +36,7 @@ if (!$gBitUser->isRegistered()) { include_once(USERS_PKG_PATH.'lookup_user_inc.php'); if ($gQueryUser->mUserId != $gBitUser->mUserId && !$gBitUser->object_has_permission($gBitUser->mUserId, $gQueryUser->mInfo['content_id'], 'bituser', 'bit_p_admin_user')) { - $smarty->assign('msg', tra('You do not have permission to edit this user\'s theme')); + $gBitSmarty->assign('msg', tra('You do not have permission to edit this user\'s theme')); $gBitSystem->display('error.tpl'); die; } @@ -124,10 +124,10 @@ if ($gQueryUser->mUserPrefs['theme'] == 'custom' && $feature_custom_user_themes } $usingCustomTheme = ($gQueryUser->mUserPrefs['theme'] == 'custom' ? true : false); -$smarty->assign_by_ref('usingCustomTheme', $usingCustomTheme); +$gBitSmarty->assign_by_ref('usingCustomTheme', $usingCustomTheme); if ($feature_user_theme == 'n') { - $smarty->assign('msg', tra("Feature disabled")); + $gBitSmarty->assign('msg', tra("Feature disabled")); $gBitSystem->display( 'error.tpl' ); die; @@ -137,12 +137,12 @@ $customCSSPath = $gQueryUser->getStoragePath('theme', $gQueryUser->mUserId, NULL $customCSSFile = $customCSSPath.'custom.css'; // Path to this user's custom stylesheet $customCSSImageURL = $gQueryUser->getStorageURL().'/theme/images/'; -$smarty->assign_by_ref('customCSSImageURL',$customCSSImageURL); +$gBitSmarty->assign_by_ref('customCSSImageURL',$customCSSImageURL); // Create a custom.css for this user if they do not already have one if (!file_exists($customCSSFile)) { if (!copy(THEMES_PKG_PATH.'/styles/basic/basic.css', $customCSSFile)) { - $smarty->assign('msg', tra("Unable to create a custom CSS file for you!")); + $gBitSmarty->assign('msg', tra("Unable to create a custom CSS file for you!")); $gBitSystem->display( 'error.tpl' ); die; } @@ -167,7 +167,7 @@ if ($usingCustomTheme) { $fp = fopen($customCSSFile, "w"); if (!$fp) { - $smarty->assign('msg', tra("You dont have permission to write the style sheet")); + $gBitSmarty->assign('msg', tra("You dont have permission to write the style sheet")); $gBitSystem->display( 'error.tpl' ); die; } @@ -196,7 +196,7 @@ if ($usingCustomTheme) { $fp = fopen($customCSSFile, "w"); if (!$fp) { - $smarty->assign('msg', tra("You dont have permission to write the style sheet")); + $gBitSmarty->assign('msg', tra("You dont have permission to write the style sheet")); $gBitSystem->display( 'error.tpl' ); die; } @@ -257,13 +257,13 @@ if ($usingCustomTheme) { // Get the list of themes the user can choose to derive from (aka Reset to) $styles = &$tcontrollib->getStyles( NULL, ($usingCustomTheme ? FALSE : TRUE), FALSE ); -$smarty->assign_by_ref( 'styles', $styles ); +$gBitSmarty->assign_by_ref( 'styles', $styles ); // $assignStyle is the default style which will be selected in the drop down list if (!isset($assignStyle)) { $assignStyle = $gQueryUser->getPreference('theme', 'basic'); } -$smarty->assign_by_ref( 'assignStyle', $assignStyle); +$gBitSmarty->assign_by_ref( 'assignStyle', $assignStyle); // Read in this user's custom.css to display in the textarea $lines = file($customCSSFile); @@ -272,13 +272,13 @@ foreach ($lines as $line) { $data .= $line; } -$smarty->assign('data', $data); +$gBitSmarty->assign('data', $data); // Export success/error messages for display in the tpl. if (isset($successMsg)) - $smarty->assign_by_ref('successMsg',$successMsg); + $gBitSmarty->assign_by_ref('successMsg',$successMsg); if (isset($errorMsg)) - $smarty->assign_by_ref('errorMsg', $errorMsg); + $gBitSmarty->assign_by_ref('errorMsg', $errorMsg); // Get the list of images used by this user's custom theme $imageList = ls_a($customCSSPath.'images/'); @@ -291,10 +291,10 @@ if( count( $imageList ) ) { } } -$smarty->assign('imagesCount', count($themeImages)); -$smarty->assign_by_ref('themeImages',$themeImages); -$smarty->assign('PHP_SELF', $_SERVER['PHP_SELF']); -$smarty->assign_by_ref('gQueryUser', $gQueryUser); +$gBitSmarty->assign('imagesCount', count($themeImages)); +$gBitSmarty->assign_by_ref('themeImages',$themeImages); +$gBitSmarty->assign('PHP_SELF', $_SERVER['PHP_SELF']); +$gBitSmarty->assign_by_ref('gQueryUser', $gQueryUser); $gBitSystem->display( 'bitpackage:users/user_theme.tpl'); ?> diff --git a/validate.php b/validate.php index 9604d62..ad97777 100644 --- a/validate.php +++ b/validate.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/validate.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/validate.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: validate.php,v 1.3 2005/07/17 17:36:44 squareing Exp $ + * $Id: validate.php,v 1.4 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -31,7 +31,7 @@ if ($gBitUser->hasPermission( 'bit_p_admin' )) { if (isset($_REQUEST["su"])) { if ($gBitUser->userExists( array( 'login' => $_REQUEST['username'] ) ) ) { $_SESSION["$user_cookie_site"] = $_REQUEST["username"]; - $smarty->assign_by_ref('user', $_REQUEST["username"]); + $gBitSmarty->assign_by_ref('user', $_REQUEST["username"]); } $url = $_SESSION['loginfrom']; //unset session variable for the next su @@ -61,8 +61,8 @@ $response = isset($_REQUEST['response']) ? $_REQUEST['response'] : false; // if $referer is set, login() will return the user to whence he came $url = $gBitUser->login( $user, $pass, $challenge, $response ); -// but if we came from a login page, let's go home -if( strpos( $url, 'login.php?' ) || strpos( $url, 'remind_password.php' ) ) { +// but if we came from a login page, let's go home (except if we got an error when login in) +if( (strpos( $url, 'login.php?' ) || strpos( $url, 'remind_password.php' )) && strpos( $url, 'login.php?error=') == -1) { $url = $gBitSystem->getDefaultPage(); } header('location: ' . $url); diff --git a/versions.php b/versions.php index fb49084..e8421d1 100644 --- a/versions.php +++ b/versions.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/Attic/versions.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/Attic/versions.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: versions.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: versions.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,39 +19,39 @@ require_once( '../bit_setup_inc.php' ); include_once( WIKI_PKG_PATH.'hist_lib.php'); if ($feature_wiki != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_wiki"); + $gBitSmarty->assign('msg', tra("This feature is disabled").": feature_wiki"); $gBitSystem->display( 'error.tpl' ); die; } // Only an admin can use this script if (!$gBitUser->isAdmin()) { - $smarty->assign('msg', tra("You dont have permission to use this feature")); + $gBitSmarty->assign('msg', tra("You dont have permission to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } // We have to get the variable ruser as the user to check if (!isset($_REQUEST["ruser"])) { - $smarty->assign('msg', tra("No user indicated")); + $gBitSmarty->assign('msg', tra("No user indicated")); $gBitSystem->display( 'error.tpl' ); die; } if (!$gBitUser->userExists( array( 'login' => $_REQUEST["ruser"] ) ) ) { - $smarty->assign('msg', tra("Unexistant user")); + $gBitSmarty->assign('msg', tra("Unexistant user")); $gBitSystem->display( 'error.tpl' ); die; } -$smarty->assign_by_ref('ruser', $_REQUEST["ruser"]); -$smarty->assign('preview', false); +$gBitSmarty->assign_by_ref('ruser', $_REQUEST["ruser"]); +$gBitSmarty->assign('preview', false); if (isset($_REQUEST["preview"])) { $version = $histlib->get_version($_REQUEST["page"], $_REQUEST["version"]); $version["data"] = $gBitSystem->parseData($version["data"]); if ($version) { - $smarty->assign_by_ref('preview', $version); - $smarty->assign_by_ref('version', $_REQUEST["version"]); + $gBitSmarty->assign_by_ref('preview', $version); + $gBitSmarty->assign_by_ref('version', $_REQUEST["version"]); } } $history = $histlib->get_user_versions($_REQUEST["ruser"]); -$smarty->assign_by_ref('history', $history); +$gBitSmarty->assign_by_ref('history', $history); $gBitSystem->display( 'bitpackage:users/userversions.tpl'); ?> diff --git a/watches.php b/watches.php index ee8f0a8..7de5518 100644 --- a/watches.php +++ b/watches.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/watches.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/watches.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: watches.php,v 1.2 2005/06/28 07:46:23 spiderr Exp $ + * $Id: watches.php,v 1.3 2005/08/01 18:42:02 squareing Exp $ * @package users * @subpackage functions */ @@ -19,7 +19,7 @@ include_once( '../bit_setup_inc.php' ); $user = $gBitUser->mUserId; if (!$user) { - $smarty->assign('msg', tra("You must log in to use this feature")); + $gBitSmarty->assign('msg', tra("You must log in to use this feature")); $gBitSystem->display( 'error.tpl' ); die; } @@ -38,13 +38,13 @@ if (isset($_REQUEST['watch'])) { } // Get watch events and put them in watch_events $events = $gBitUser->get_watches_events(); -$smarty->assign('events', $events); +$gBitSmarty->assign('events', $events); // if not set event type then all if (!isset($_REQUEST['event'])) $_REQUEST['event'] = ''; // get all the information for the event $watches = $gBitUser->getWatches( $_REQUEST['event'] ); -$smarty->assign('watches', $watches); +$gBitSmarty->assign('watches', $watches); $gBitSystem->display( 'bitpackage:users/user_watches.tpl'); ?> |
