[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Definition of eZForgotPassword class 4 // 5 // Created on: <17-íÁÒ-2003 11:40:49 sp> 6 // 7 // SOFTWARE NAME: eZ publish 8 // SOFTWARE RELEASE: 3.9.0 9 // BUILD VERSION: 17785 10 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 11 // SOFTWARE LICENSE: GNU General Public License v2.0 12 // NOTICE: > 13 // This program is free software; you can redistribute it and/or 14 // modify it under the terms of version 2.0 of the GNU General 15 // Public License as published by the Free Software Foundation. 16 // 17 // This program is distributed in the hope that it will be useful, 18 // but WITHOUT ANY WARRANTY; without even the implied warranty of 19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 // GNU General Public License for more details. 21 // 22 // You should have received a copy of version 2.0 of the GNU General 23 // Public License along with this program; if not, write to the Free 24 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 25 // MA 02110-1301, USA. 26 // 27 // 28 29 /*! \file ezforgotpassword.php 30 */ 31 32 /*! 33 \class eZForgotPassword ezforgotpassword.php 34 \ingroup eZDatatype 35 \brief The class eZForgotPassword does 36 37 */ 38 39 include_once ( 'kernel/classes/ezpersistentobject.php' ); 40 41 class eZForgotPassword extends eZPersistentObject 42 { 43 /*! 44 Constructor 45 */ 46 function eZForgotPassword( $row = array() ) 47 { 48 $this->eZPersistentObject( $row ); 49 } 50 51 function definition() 52 { 53 return array( "fields" => array( "id" => array( 'name' => 'ID', 54 'datatype' => 'integer', 55 'default' => 0, 56 'required' => true ), 57 "user_id" => array( 'name' => "UserID", 58 'datatype' => 'integer', 59 'default' => 0, 60 'required' => true, 61 'foreign_class' => 'eZUser', 62 'foreign_attribute' => 'contentobject_id', 63 'multiplicity' => '0..*' ), 64 "hash_key" => array( 'name' => "HashKey", 65 'datatype' => 'string', 66 'default' => '', 67 'required' => true ), 68 "time" => array( 'name' => "Time", 69 'datatype' => 'integer', 70 'default' => 0, 71 'required' => true ) ), 72 "keys" => array( "id" ), 73 "increment_key" => "id", 74 "sort" => array( "id" => "asc" ), 75 "class_name" => "eZForgotPassword", 76 "name" => "ezforgot_password" ); 77 } 78 79 function createNew( $userID, $hashKey, $time) 80 { 81 return new eZForgotPassword( array( "user_id" => $userID, 82 "hash_key" => $hashKey, 83 "time" => $time ) ); 84 } 85 86 function fetchByKey( $hashKey ) 87 { 88 return eZPersistentObject::fetchObject( eZForgotPassword::definition(), 89 null, 90 array( "hash_key" => $hashKey ), 91 true ); 92 } 93 94 /*! 95 \static 96 Removes all password reminders in the database. 97 */ 98 function cleanup() 99 { 100 $db =& eZDB::instance(); 101 $db->query( "DELETE FROM ezforgot_password" ); 102 } 103 104 /*! 105 Remove forgot password entries belonging to user \a $userID 106 */ 107 function remove( $userID = false ) 108 { 109 if ( $userID === false ) 110 { 111 if ( get_class( $this ) == 'ezforgotpassword' ) 112 { 113 eZPersistentObject::removeObject( eZForgotPassword::definition(), 114 array( 'id' => $this->attribute( 'id' ) ) ); 115 } 116 } 117 else 118 { 119 eZPersistentObject::removeObject( eZForgotPassword::definition(), 120 array( 'user_id' => $userID ) ); 121 } 122 } 123 124 } 125 126 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |