import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkeys Ltd.
|
||||
* @since Textroller 0.9
|
||||
* @package TextRoller
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
|
||||
class OpenIdUser extends Zend_OpenId_Provider_User
|
||||
{
|
||||
private $_auth;
|
||||
private $_user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_auth = Zend_Auth::getInstance();
|
||||
}
|
||||
|
||||
public function setLoggedInUser($id)
|
||||
{
|
||||
|
||||
$users = new Users();
|
||||
$this->_user = $users->getuserWithOpenId($id);
|
||||
$this->_auth->getStorage()->write($this->_user);
|
||||
}
|
||||
|
||||
public function getLoggedInUser()
|
||||
{
|
||||
$users = new Users();
|
||||
if ($this->_auth->hasIdentity()) {
|
||||
$user = $this->_auth->getStorage()->read();
|
||||
$user->init();
|
||||
|
||||
// reactivate row as live data
|
||||
$user->setTable($users);
|
||||
|
||||
return $user->openid;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function delLoggedInUser()
|
||||
{
|
||||
$this->_auth->clearIdentity();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ class Users_Model_Users extends Monkeys_Db_Table_Gateway
|
||||
'status' => array('accepted_eula', 'registration_date', 'firstname', 'lastname'),
|
||||
);
|
||||
|
||||
public function createRow()
|
||||
public function createRow(array $data = array(), $defaultSource = null)
|
||||
{
|
||||
return parent::createRow(array(
|
||||
'openid' => '',
|
||||
@ -176,7 +176,7 @@ class Users_Model_Users extends Monkeys_Db_Table_Gateway
|
||||
|
||||
public function getUnconfirmedUsers($olderThanDays)
|
||||
{
|
||||
$date = date('Y-m-d', strtotime("$olderThanDays days ago"));
|
||||
$date = date('Y-m-d 23:59:59', strtotime("$olderThanDays days ago"));
|
||||
$select = $this->select()
|
||||
->where('accepted_eula=0')
|
||||
->where('registration_date < ?', $date);
|
||||
@ -184,7 +184,7 @@ class Users_Model_Users extends Monkeys_Db_Table_Gateway
|
||||
return $this->fetchAll($select);
|
||||
}
|
||||
|
||||
public function deleteUser(User $user)
|
||||
public function deleteUser(Users_Model_User $user)
|
||||
{
|
||||
$where = $this->getAdapter()->quoteInto('id=?', $user->id);
|
||||
$this->delete($where);
|
||||
@ -424,5 +424,22 @@ class Users_Model_Users extends Monkeys_Db_Table_Gateway
|
||||
'PRIMARY_POSITION' => NULL,
|
||||
'IDENTITY' => false,
|
||||
),
|
||||
'reminders' =>
|
||||
array (
|
||||
'SCHEMA_NAME' => NULL,
|
||||
'TABLE_NAME' => 'users',
|
||||
'COLUMN_NAME' => 'reminders',
|
||||
'COLUMN_POSITION' => 14,
|
||||
'DATA_TYPE' => 'int',
|
||||
'DEFAULT' => '0',
|
||||
'NULLABLE' => false,
|
||||
'LENGTH' => NULL,
|
||||
'SCALE' => NULL,
|
||||
'PRECISION' => NULL,
|
||||
'UNSIGNED' => NULL,
|
||||
'PRIMARY' => false,
|
||||
'PRIMARY_POSITION' => NULL,
|
||||
'IDENTITY' => false,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user