Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Mon, Jul 7, 4:35 PM

in-portal

Index: branches/RC/themes/default2007/platform/members_list.tpl
===================================================================
--- branches/RC/themes/default2007/platform/members_list.tpl (nonexistent)
+++ branches/RC/themes/default2007/platform/members_list.tpl (revision 10204)
@@ -0,0 +1,51 @@
+<!--## PAGE TITLE ELEMENT ##-->
+<inp2:m_DefineElement name="page_title">
+ <inp2:m_phrase name="lu_title_Members"/>
+</inp2:m_DefineElement>
+<!--## //PAGE TITLE ELEMENT ##-->
+
+<inp2:m_DefineElement name="sidebar">
+ <inp2:m_RenderElements
+ elements="
+ platform/elements/side_boxes/login,
+ platform/elements/side_boxes/search,
+ platform/elements/side_boxes/recommend_site,
+ platform/elements/side_boxes/mailing_list,
+ "
+ design="blue_box"/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="content">
+ <inp2:m_include template="platform/elements/navigation_bar" titles="lu_title_Members" templates="platform/members_list"/>
+
+ <!--## links in category ##-->
+ <inp2:m_RenderElement design="content_box" data_exists="1" block_no_data="no_users">
+ <inp2:u.all_InitList list_name="all_members"/>
+
+ <inp2:m_Capture to_var="header">
+ <inp2:m_phrase name="lu_title_Members"/> (<inp2:u.all_TotalRecords list_name="all_members"/>)
+ </inp2:m_Capture>
+
+ <inp2:m_include template="platform/designs/users"/>
+
+ <table class="fullwidth">
+ <tr>
+ <td colspan="4">
+ <div class="horizontal-separator"><img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="1" height="1" alt="" /></div>
+ </td>
+ </tr>
+ <tr class="sub-section-header">
+ <td><inp2:m_Phrase label="lu_col_Login"/></td>
+ <td><inp2:m_Phrase label="lu_col_LoggedIn"/></td>
+ <td><inp2:m_Phrase label="lu_col_Email"/></td>
+ <td><inp2:m_Phrase label="lu_col_MemberSince"/></td>
+ </tr>
+ <inp2:u.all_PrintList list_name="all_members" render_as="user_element" direction="H"/>
+ </table>
+
+ <inp2:m_include template="platform/elements/pagination" prefix="u.all" list_name="all_members"/>
+ </inp2:m_RenderElement>
+
+</inp2:m_DefineElement>
+
+<inp2:m_include template="platform/designs/default_design" pass_params="1"/>
\ No newline at end of file
Property changes on: branches/RC/themes/default2007/platform/members_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/themes/default2007/platform/designs/users.tpl
===================================================================
--- branches/RC/themes/default2007/platform/designs/users.tpl (nonexistent)
+++ branches/RC/themes/default2007/platform/designs/users.tpl (revision 10204)
@@ -0,0 +1,35 @@
+<!--## DESIGNS OF LINK ELEMENTS DESCRIBED IN THIS TEMPLATE ##-->
+
+<!--## USER ELEMENT ##-->
+<inp2:m_DefineElement name="user_element">
+ <tr>
+ <td colspan="4">
+ <div class="horizontal-separator"><img src="<inp2:m_TemplatesBase module="In-Portal"/>img/s.gif" width="1" height="1" alt="" /></div>
+ </td>
+ </tr>
+ <tr class="listing-row">
+ <td valign="top">
+ <a href="<inp2:ProfileLink template="platform/my_account/public_profile"/>"><inp2:Field name="Login"/></a>
+ </td>
+ <td valign="top">
+ <inp2:m_if check="LoggedIn">
+ <inp2:m_Phrase name="lu_Yes"/>
+ <inp2:m_else/>
+ <inp2:m_Phrase name="lu_No"/>
+ </inp2:m_if>
+ </td>
+ <td valign="top">
+ <inp2:Field name="Email"/>
+ </td>
+ <td valign="top">
+ <inp2:Field name="CreatedOn"/>
+ </td>
+ </tr>
+</inp2:m_DefineElement>
+<!--## /USER ELEMENT ##-->
+
+<!--## NO USERS ELEMENT ##-->
+<inp2:m_DefineElement name="no_users">
+ <inp2:m_phrase name="lu_NoMembers"/>
+</inp2:m_DefineElement>
+<!--## /NO USERS ELEMENT ##-->
\ No newline at end of file
Property changes on: branches/RC/themes/default2007/platform/designs/users.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/core/units/users/users_tag_processor.php
===================================================================
--- branches/RC/core/units/users/users_tag_processor.php (revision 10203)
+++ branches/RC/core/units/users/users_tag_processor.php (revision 10204)
@@ -1,231 +1,249 @@
<?php
class UsersTagProcessor extends kDBTagProcessor
{
function LogoutLink($params)
{
$pass = Array('pass' => 'all,m,u', 'u_event' => 'OnLogout', 'm_cat_id'=>0);
$logout_template = $this->SelectParam($params, 'template,t');
return $this->Application->HREF($logout_template, '', $pass);
}
function UseUsernames($params)
{
return $this->Application->ConfigValue('Email_As_Login') != 1;
}
function RegistrationEnabled($params)
{
return $this->Application->ConfigValue('User_Allow_New') != 2;
}
function SuggestRegister($params)
{
return !$this->Application->LoggedIn() && !$this->Application->ConfigValue('Comm_RequireLoginBeforeCheckout') && $this->RegistrationEnabled($params);
}
function ConfirmPasswordLink($params)
{
$code = $this->getCachedCode();
$fields_hash = Array (
'PwResetConfirm' => $code,
'PwRequestTime' => adodb_mktime(),
);
$user_id = $this->Application->RecallVar('tmp_user_id');
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PortalUser', 'PortalUserId = '.$user_id);
$params['user_key'] = $code;
if (!$this->SelectParam($params, 'template,t')) {
$params['template'] = $this->Application->GetVar('reset_confirm_template');
}
return $this->Application->ProcessParsedTag('m', 'Link', $params);
}
/**
* Generates & caches code for password confirmation link
*
* @return string
*/
function getCachedCode()
{
static $code = null;
if (!isset($code)) {
$code = md5($this->GenerateCode());
}
return $code;
}
function GenerateCode()
{
list($usec, $sec) = explode(" ",microtime());
$id_part_1 = substr($usec, 4, 4);
$id_part_2 = mt_rand(1,9);
$id_part_3 = substr($sec, 6, 4);
$digit_one = substr($id_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$id_part_1 = ereg_replace("^0","",$id_part_1);
$id_part_1=$digit_one.$id_part_1;
}
return $id_part_1.$id_part_2.$id_part_3;
}
function ForgottenPassword($params)
{
return $this->Application->GetVar('ForgottenPassword');
}
function TestCodeIsValid($params)
{
$passed_key = trim($this->Application->GetVar('user_key'));
// used for error reporting only -> rewrite code + theme (by Alex)
$user_current_object = &$this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too
/* @var $user_current_object UsersItem */
if (!$passed_key) {
$user_current_object->SetError('PwResetConfirm', 'code_is_not_valid', 'lu_code_is_not_valid');
return false;
}
$user_object =& $this->Application->recallObject('u.forgot', null, Array('skip_autoload' => true));
/* @var $user_object UsersItems */
$user_object->Load($passed_key, 'PwResetConfirm');
if ($user_object->isLoaded()) {
$expiration_time = $user_object->GetDBField('PwRequestTime') + 3600;
if ($expiration_time > adodb_mktime()) {
return true;
} else {
$user_current_object->SetError('PwResetConfirm', 'code_expired', 'lu_code_expired');
return false;
}
}
else {
$user_current_object->SetError('PwResetConfirm', 'code_is_not_valid', 'lu_code_is_not_valid');
return false;
}
return true;
}
/**
* Returns sitem administrator email
*
* @param Array $params
* @return string
*/
function SiteAdminEmail($params)
{
return $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
function AffiliatePaymentTypeChecked($params)
{
static $checked = false;
if( $this->Application->GetVar('PaymentTypeId') )
{
$apt_object =& $this->Application->recallObject('apt.active');
if( $this->Application->GetVar('PaymentTypeId') == $apt_object->GetDBField('PaymentTypeId') )
{
return 1;
}
else
{
return 0;
}
}
if(!$checked)
{
$checked = true;
return 1;
}
else
{
return 0;
}
}
function HasError($params)
{
$res = parent::HasError($params);
if($this->SelectParam($params,'field,fields') == 'any')
{
$res = $res || $this->Application->GetVar('MustAgreeToTerms'); // need to do it not put module fields into kernel ! (noticed by Alex)
$res = $res || $this->Application->GetVar('SSNRequiredError');
}
return $res;
}
/**
* Returns login name of user
*
* @param Array $params
*/
function LoginName($params)
{
$object =& $this->getObject($params);
return $object->GetID() != -1 ? $object->GetDBField('Login') : 'root';
}
function CookieUsername($params)
{
$submit_value = $this->Application->GetVar($params['submit_field']);
if ($submit_value !== false) {
return $submit_value;
}
$username = $this->Application->GetVar('save_username'); // from cookie
if ($username == 'super-root') {
$username = 'root';
}
return $username === false ? '' : $username;
}
/**
* Checks if user have one of required permissions
*
* @param Array $params
* @return bool
*/
function HasPermission($params)
{
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
return $perm_helper->TagPermissionCheck($params);
}
/**
* Returns link to user public profile
*
* @param Array $params
* @return string
*/
function ProfileLink($params)
{
$object =& $this->getObject($params);
$params['user_id'] = $object->GetID();
return $this->Application->ProcessParsedTag('m', 'Link', $params);
}
function ImageSrc($params)
{
list ($ret, $tag_processed) = $this->processAggregatedTag('ImageSrc', $params, $this->getPrefixSpecial());
return $tag_processed ? $ret : false;
}
+
+ function LoggedIn($params)
+ {
+ static $loggedin_status = Array ();
+
+ $object =& $this->getObject($params);
+ /* @var $object kDBList */
+
+ if (!isset($loggedin_status[$this->Special])) {
+ $user_ids = $object->GetCol($object->IDField);
+ $sql = 'SELECT LastAccessed, '.$object->IDField.'
+ FROM '.TABLE_PREFIX.'UserSession
+ WHERE (PortalUserId IN ('.implode(',', $user_ids).'))';
+ $loggedin_status[$this->Special] = $this->Conn->GetCol($sql, $object->IDField);
+ }
+
+ return isset($loggedin_status[$this->Special][$object->GetID()]);
+ }
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/users/users_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.22.2.4
\ No newline at end of property
+1.22.2.5
\ No newline at end of property

Event Timeline