2010-04-22 17:03:54 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2011-04-15 15:14:02 +00:00
|
|
|
* ownCloud
|
|
|
|
*
|
|
|
|
* @author Frank Karlitschek
|
2012-05-26 17:14:24 +00:00
|
|
|
* @copyright 2012 Frank Karlitschek frank@owncloud.org
|
2011-04-15 15:14:02 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 3 of the License, or any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2010-04-24 10:40:20 +00:00
|
|
|
|
2010-04-22 17:03:54 +00:00
|
|
|
/**
|
2012-06-01 15:34:09 +00:00
|
|
|
* This class provides wrapper methods for user management. Multiple backends are
|
|
|
|
* supported. User management operations are delegated to the configured backend for
|
|
|
|
* execution.
|
2011-04-18 09:39:29 +00:00
|
|
|
*
|
|
|
|
* Hooks provided:
|
|
|
|
* pre_createUser(&run, uid, password)
|
|
|
|
* post_createUser(uid, password)
|
|
|
|
* pre_deleteUser(&run, uid)
|
|
|
|
* post_deleteUser(uid)
|
|
|
|
* pre_setPassword(&run, uid, password)
|
|
|
|
* post_setPassword(uid, password)
|
|
|
|
* pre_login(&run, uid)
|
|
|
|
* post_login(uid)
|
|
|
|
* logout()
|
2010-04-22 17:03:54 +00:00
|
|
|
*/
|
2011-07-29 19:36:03 +00:00
|
|
|
class OC_User {
|
2010-07-21 15:53:51 +00:00
|
|
|
// The backend used for user management
|
2011-06-21 17:28:46 +00:00
|
|
|
private static $_usedBackends = array();
|
2011-04-15 15:14:02 +00:00
|
|
|
|
|
|
|
// Backends available (except database)
|
|
|
|
private static $_backends = array();
|
2010-07-21 15:53:51 +00:00
|
|
|
|
|
|
|
/**
|
2011-04-15 15:14:02 +00:00
|
|
|
* @brief registers backend
|
|
|
|
* @param $name name of the backend
|
|
|
|
* @returns true/false
|
2010-07-22 21:42:18 +00:00
|
|
|
*
|
2011-04-15 15:14:02 +00:00
|
|
|
* Makes a list of backends that can be used by other modules
|
2010-07-22 21:42:18 +00:00
|
|
|
*/
|
2011-04-15 15:14:02 +00:00
|
|
|
public static function registerBackend( $name ){
|
|
|
|
self::$_backends[] = $name;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief gets available backends
|
|
|
|
* @returns array of backends
|
|
|
|
*
|
|
|
|
* Returns the names of all backends.
|
|
|
|
*/
|
|
|
|
public static function getBackends(){
|
|
|
|
return self::$_backends;
|
|
|
|
}
|
2011-06-23 13:24:09 +00:00
|
|
|
|
2011-06-21 17:28:46 +00:00
|
|
|
/**
|
|
|
|
* @brief gets used backends
|
|
|
|
* @returns array of backends
|
|
|
|
*
|
|
|
|
* Returns the names of all used backends.
|
|
|
|
*/
|
|
|
|
public static function getUsedBackends(){
|
|
|
|
return array_keys(self::$_usedBackends);
|
|
|
|
}
|
2011-04-15 15:14:02 +00:00
|
|
|
|
|
|
|
/**
|
2011-06-21 17:28:46 +00:00
|
|
|
* @brief Adds the backend to the list of used backends
|
2011-04-15 15:14:02 +00:00
|
|
|
* @param $backend default: database The backend to use for user managment
|
|
|
|
* @returns true/false
|
|
|
|
*
|
|
|
|
* Set the User Authentication Module
|
|
|
|
*/
|
2011-06-21 17:28:46 +00:00
|
|
|
public static function useBackend( $backend = 'database' ){
|
2011-04-15 15:14:02 +00:00
|
|
|
// You'll never know what happens
|
|
|
|
if( null === $backend OR !is_string( $backend )){
|
2010-07-21 15:53:51 +00:00
|
|
|
$backend = 'database';
|
|
|
|
}
|
|
|
|
|
2011-04-15 15:14:02 +00:00
|
|
|
// Load backend
|
|
|
|
switch( $backend ){
|
2010-07-22 22:48:45 +00:00
|
|
|
case 'database':
|
2010-07-21 15:53:51 +00:00
|
|
|
case 'mysql':
|
|
|
|
case 'sqlite':
|
2011-07-29 19:36:03 +00:00
|
|
|
self::$_usedBackends[$backend] = new OC_User_Database();
|
2010-07-21 15:53:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
2010-07-22 22:48:45 +00:00
|
|
|
$className = 'OC_USER_' . strToUpper($backend);
|
2011-06-21 17:28:46 +00:00
|
|
|
self::$_usedBackends[$backend] = new $className();
|
2010-07-21 15:53:51 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-07-19 16:52:49 +00:00
|
|
|
|
2011-04-15 15:14:02 +00:00
|
|
|
true;
|
2010-07-21 15:53:51 +00:00
|
|
|
}
|
2010-07-19 16:52:49 +00:00
|
|
|
|
2010-04-22 17:03:54 +00:00
|
|
|
/**
|
2011-04-18 08:41:01 +00:00
|
|
|
* @brief Create a new user
|
2011-04-18 09:39:29 +00:00
|
|
|
* @param $uid The username of the user to create
|
2011-04-15 15:14:02 +00:00
|
|
|
* @param $password The password of the new user
|
2011-04-18 08:41:01 +00:00
|
|
|
* @returns true/false
|
|
|
|
*
|
2011-07-29 19:36:03 +00:00
|
|
|
* Creates a new user. Basic checking of username is done in OC_User
|
2011-04-18 09:39:29 +00:00
|
|
|
* itself, not in its subclasses.
|
|
|
|
*
|
|
|
|
* Allowed characters in the username are: "a-z", "A-Z", "0-9" and "_.@-"
|
2010-07-22 21:42:18 +00:00
|
|
|
*/
|
2011-04-18 09:39:29 +00:00
|
|
|
public static function createUser( $uid, $password ){
|
|
|
|
// Check the name for bad characters
|
|
|
|
// Allowed are: "a-z", "A-Z", "0-9" and "_.@-"
|
|
|
|
if( preg_match( '/[^a-zA-Z0-9 _\.@\-]/', $uid )){
|
2012-05-06 22:04:31 +00:00
|
|
|
throw new Exception('Only the following characters are allowed in a username: "a-z", "A-Z", "0-9", and "_.@-"');
|
2011-04-18 09:39:29 +00:00
|
|
|
}
|
2011-04-18 09:48:52 +00:00
|
|
|
// No empty username
|
2012-01-02 10:49:53 +00:00
|
|
|
if(trim($uid) == ''){
|
2012-05-06 22:04:31 +00:00
|
|
|
throw new Exception('A valid username must be provided');
|
2011-04-18 09:48:52 +00:00
|
|
|
}
|
2012-05-13 18:53:45 +00:00
|
|
|
// No empty password
|
|
|
|
if(trim($password) == ''){
|
|
|
|
throw new Exception('A valid password must be provided');
|
|
|
|
}
|
2012-06-04 19:31:35 +00:00
|
|
|
|
2011-04-18 10:39:28 +00:00
|
|
|
// Check if user already exists
|
2011-06-21 17:28:46 +00:00
|
|
|
if( self::userExists($uid) ){
|
2012-05-06 22:04:31 +00:00
|
|
|
throw new Exception('The username is already being used');
|
2011-04-18 10:39:28 +00:00
|
|
|
}
|
|
|
|
|
2011-04-18 09:48:52 +00:00
|
|
|
|
2011-04-18 09:39:29 +00:00
|
|
|
$run = true;
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "pre_createUser", array( "run" => &$run, "uid" => $uid, "password" => $password ));
|
2011-04-18 09:39:29 +00:00
|
|
|
|
2011-06-21 17:28:46 +00:00
|
|
|
if( $run ){
|
|
|
|
//create the user in the first backend that supports creating users
|
|
|
|
foreach(self::$_usedBackends as $backend){
|
2011-06-23 13:24:09 +00:00
|
|
|
if(!$backend->implementsActions(OC_USER_BACKEND_CREATE_USER))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
$backend->createUser($uid,$password);
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "post_createUser", array( "uid" => $uid, "password" => $password ));
|
2011-06-23 13:24:09 +00:00
|
|
|
|
|
|
|
return true;
|
2011-06-21 17:28:46 +00:00
|
|
|
}
|
2011-04-18 09:39:29 +00:00
|
|
|
}
|
2011-06-21 17:28:46 +00:00
|
|
|
return false;
|
2010-07-21 15:53:51 +00:00
|
|
|
}
|
2010-07-19 16:52:49 +00:00
|
|
|
|
2011-04-16 23:04:23 +00:00
|
|
|
/**
|
2011-04-18 08:41:01 +00:00
|
|
|
* @brief delete a user
|
|
|
|
* @param $uid The username of the user to delete
|
|
|
|
* @returns true/false
|
|
|
|
*
|
|
|
|
* Deletes a user
|
2011-04-16 23:04:23 +00:00
|
|
|
*/
|
2011-04-18 08:41:01 +00:00
|
|
|
public static function deleteUser( $uid ){
|
2011-04-18 09:39:29 +00:00
|
|
|
$run = true;
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "pre_deleteUser", array( "run" => &$run, "uid" => $uid ));
|
2011-04-18 09:39:29 +00:00
|
|
|
|
2011-06-21 17:28:46 +00:00
|
|
|
if( $run ){
|
|
|
|
//delete the user from all backends
|
|
|
|
foreach(self::$_usedBackends as $backend){
|
2012-05-08 07:07:11 +00:00
|
|
|
$backend->deleteUser($uid);
|
2011-06-21 17:28:46 +00:00
|
|
|
}
|
2011-04-18 09:48:52 +00:00
|
|
|
// We have to delete the user from all groups
|
2011-07-29 19:36:03 +00:00
|
|
|
foreach( OC_Group::getUserGroups( $uid ) as $i ){
|
|
|
|
OC_Group::removeFromGroup( $uid, $i );
|
2011-04-18 09:48:52 +00:00
|
|
|
}
|
2012-01-04 20:19:16 +00:00
|
|
|
// Delete the user's keys in preferences
|
|
|
|
OC_Preferences::deleteUser($uid);
|
2011-04-18 09:48:52 +00:00
|
|
|
// Emit and exit
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "post_deleteUser", array( "uid" => $uid ));
|
2011-04-18 09:39:29 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-16 23:04:23 +00:00
|
|
|
}
|
|
|
|
|
2010-04-22 17:03:54 +00:00
|
|
|
/**
|
2011-04-18 08:41:01 +00:00
|
|
|
* @brief Try to login a user
|
|
|
|
* @param $uid The username of the user to log in
|
2011-04-15 15:14:02 +00:00
|
|
|
* @param $password The password of the user
|
2011-04-18 08:41:01 +00:00
|
|
|
* @returns true/false
|
|
|
|
*
|
2012-03-13 15:00:53 +00:00
|
|
|
* Log in a user and regenerate a new session - if the password is ok
|
2010-07-22 21:42:18 +00:00
|
|
|
*/
|
2011-04-18 08:41:01 +00:00
|
|
|
public static function login( $uid, $password ){
|
2011-04-18 09:39:29 +00:00
|
|
|
$run = true;
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "pre_login", array( "run" => &$run, "uid" => $uid ));
|
2011-04-18 09:39:29 +00:00
|
|
|
|
2011-08-25 19:51:04 +00:00
|
|
|
if( $run ){
|
|
|
|
$uid=self::checkPassword( $uid, $password );
|
|
|
|
if($uid){
|
2012-03-13 15:00:53 +00:00
|
|
|
session_regenerate_id();
|
2012-02-05 20:49:22 +00:00
|
|
|
self::setUserId($uid);
|
2011-11-24 00:44:54 +00:00
|
|
|
OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid, 'password'=>$password ));
|
2012-02-05 20:49:22 +00:00
|
|
|
return true;
|
2011-08-25 19:51:04 +00:00
|
|
|
}
|
2011-04-18 09:39:29 +00:00
|
|
|
}
|
2011-09-18 13:05:53 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sets user id for session and triggers emit
|
|
|
|
* @returns true
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public static function setUserId($uid) {
|
|
|
|
$_SESSION['user_id'] = $uid;
|
|
|
|
return true;
|
2010-07-21 15:53:51 +00:00
|
|
|
}
|
2010-07-19 16:52:49 +00:00
|
|
|
|
2011-03-01 22:20:16 +00:00
|
|
|
/**
|
2012-05-01 19:07:08 +00:00
|
|
|
* @brief Logs the current user out and kills all the session data
|
2011-04-18 08:41:01 +00:00
|
|
|
* @returns true
|
|
|
|
*
|
|
|
|
* Logout, destroys session
|
2011-03-01 22:20:16 +00:00
|
|
|
*/
|
2011-04-15 15:14:02 +00:00
|
|
|
public static function logout(){
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "logout", array());
|
2012-03-13 15:00:53 +00:00
|
|
|
session_unset();
|
|
|
|
session_destroy();
|
2011-09-18 13:05:53 +00:00
|
|
|
OC_User::unsetMagicInCookie();
|
2011-06-21 17:28:46 +00:00
|
|
|
return true;
|
2011-03-01 22:20:16 +00:00
|
|
|
}
|
|
|
|
|
2010-04-22 17:03:54 +00:00
|
|
|
/**
|
2011-04-15 15:14:02 +00:00
|
|
|
* @brief Check if the user is logged in
|
2011-04-18 08:41:01 +00:00
|
|
|
* @returns true/false
|
|
|
|
*
|
|
|
|
* Checks if the user is logged in
|
2010-07-22 21:42:18 +00:00
|
|
|
*/
|
2011-04-15 15:14:02 +00:00
|
|
|
public static function isLoggedIn(){
|
2012-06-19 15:54:19 +00:00
|
|
|
static $is_login_checked = null;
|
|
|
|
if (!is_null($is_login_checked)) {
|
|
|
|
return $is_login_checked;
|
|
|
|
}
|
2012-06-04 19:31:35 +00:00
|
|
|
if( isset($_SESSION['user_id']) AND $_SESSION['user_id']) {
|
|
|
|
OC_App::loadApps(array('authentication'));
|
|
|
|
if (self::userExists($_SESSION['user_id']) ){
|
2012-06-19 15:54:19 +00:00
|
|
|
return $is_login_checked = true;
|
2012-06-04 19:31:35 +00:00
|
|
|
}
|
2011-06-21 17:28:46 +00:00
|
|
|
}
|
2012-06-19 15:54:19 +00:00
|
|
|
return $is_login_checked = false;
|
2010-07-21 15:53:51 +00:00
|
|
|
}
|
2010-07-19 16:52:49 +00:00
|
|
|
|
2011-06-22 10:50:57 +00:00
|
|
|
/**
|
2012-04-30 11:08:08 +00:00
|
|
|
* @brief get the user id of the user currently logged in.
|
2011-06-22 10:50:57 +00:00
|
|
|
* @return string uid or false
|
|
|
|
*/
|
|
|
|
public static function getUser(){
|
|
|
|
if( isset($_SESSION['user_id']) AND $_SESSION['user_id'] ){
|
|
|
|
return $_SESSION['user_id'];
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-22 17:03:54 +00:00
|
|
|
/**
|
2011-04-18 08:41:01 +00:00
|
|
|
* @brief Autogenerate a password
|
|
|
|
* @returns string
|
|
|
|
*
|
|
|
|
* generates a password
|
2010-07-22 21:42:18 +00:00
|
|
|
*/
|
2011-04-15 15:14:02 +00:00
|
|
|
public static function generatePassword(){
|
2011-06-21 17:28:46 +00:00
|
|
|
return uniqId();
|
2010-07-21 15:53:51 +00:00
|
|
|
}
|
2010-07-19 16:52:49 +00:00
|
|
|
|
2010-04-22 17:03:54 +00:00
|
|
|
/**
|
2011-04-18 08:41:01 +00:00
|
|
|
* @brief Set password
|
|
|
|
* @param $uid The username
|
|
|
|
* @param $password The new password
|
|
|
|
* @returns true/false
|
|
|
|
*
|
|
|
|
* Change the password of a user
|
2010-07-22 21:42:18 +00:00
|
|
|
*/
|
2011-04-18 08:41:01 +00:00
|
|
|
public static function setPassword( $uid, $password ){
|
2011-04-18 09:39:29 +00:00
|
|
|
$run = true;
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "pre_setPassword", array( "run" => &$run, "uid" => $uid, "password" => $password ));
|
2011-04-18 09:39:29 +00:00
|
|
|
|
2011-06-21 17:28:46 +00:00
|
|
|
if( $run ){
|
2012-05-01 11:40:01 +00:00
|
|
|
$success = false;
|
2011-06-21 17:28:46 +00:00
|
|
|
foreach(self::$_usedBackends as $backend){
|
2011-06-23 16:23:06 +00:00
|
|
|
if($backend->implementsActions(OC_USER_BACKEND_SET_PASSWORD)){
|
|
|
|
if($backend->userExists($uid)){
|
2012-05-01 12:40:56 +00:00
|
|
|
$success |= $backend->setPassword($uid,$password);
|
2011-06-23 16:23:06 +00:00
|
|
|
}
|
2011-06-21 17:28:46 +00:00
|
|
|
}
|
|
|
|
}
|
2011-07-29 19:36:03 +00:00
|
|
|
OC_Hook::emit( "OC_User", "post_setPassword", array( "uid" => $uid, "password" => $password ));
|
2012-05-01 11:40:01 +00:00
|
|
|
return $success;
|
2011-04-18 09:39:29 +00:00
|
|
|
}
|
|
|
|
else{
|
|
|
|
return false;
|
|
|
|
}
|
2010-07-21 15:53:51 +00:00
|
|
|
}
|
2010-07-19 16:52:49 +00:00
|
|
|
|
2010-04-22 17:03:54 +00:00
|
|
|
/**
|
2011-04-18 08:41:01 +00:00
|
|
|
* @brief Check if the password is correct
|
|
|
|
* @param $uid The username
|
|
|
|
* @param $password The password
|
2012-05-16 22:57:43 +00:00
|
|
|
* @returns string
|
2011-04-18 08:41:01 +00:00
|
|
|
*
|
|
|
|
* Check if the password is correct without logging in the user
|
2012-05-16 22:57:43 +00:00
|
|
|
* returns the user id or false
|
2010-07-22 21:42:18 +00:00
|
|
|
*/
|
2011-04-18 08:41:01 +00:00
|
|
|
public static function checkPassword( $uid, $password ){
|
2011-06-21 17:28:46 +00:00
|
|
|
foreach(self::$_usedBackends as $backend){
|
2011-06-23 16:23:06 +00:00
|
|
|
if($backend->implementsActions(OC_USER_BACKEND_CHECK_PASSWORD)){
|
|
|
|
$result=$backend->checkPassword( $uid, $password );
|
2011-08-25 19:51:04 +00:00
|
|
|
if($result){
|
|
|
|
return $result;
|
2011-06-23 16:23:06 +00:00
|
|
|
}
|
2011-06-21 17:28:46 +00:00
|
|
|
}
|
|
|
|
}
|
2010-07-21 15:53:51 +00:00
|
|
|
}
|
2010-07-15 17:10:20 +00:00
|
|
|
|
2010-09-15 16:24:14 +00:00
|
|
|
/**
|
2011-04-18 08:41:01 +00:00
|
|
|
* @brief Get a list of all users
|
|
|
|
* @returns array with all uids
|
|
|
|
*
|
|
|
|
* Get a list of all users.
|
2010-09-15 16:24:14 +00:00
|
|
|
*/
|
2011-04-15 15:14:02 +00:00
|
|
|
public static function getUsers(){
|
2011-06-21 17:28:46 +00:00
|
|
|
$users=array();
|
|
|
|
foreach(self::$_usedBackends as $backend){
|
2012-05-08 07:07:11 +00:00
|
|
|
$backendUsers=$backend->getUsers();
|
|
|
|
if(is_array($backendUsers)){
|
|
|
|
$users=array_merge($users,$backendUsers);
|
2011-06-21 17:28:46 +00:00
|
|
|
}
|
|
|
|
}
|
2012-06-01 12:18:14 +00:00
|
|
|
asort($users);
|
2011-06-21 17:28:46 +00:00
|
|
|
return $users;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief check if a user exists
|
|
|
|
* @param string $uid the username
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public static function userExists($uid){
|
|
|
|
foreach(self::$_usedBackends as $backend){
|
2012-05-08 07:07:11 +00:00
|
|
|
$result=$backend->userExists($uid);
|
|
|
|
if($result===true){
|
|
|
|
return true;
|
2011-06-21 17:28:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2010-09-15 16:24:14 +00:00
|
|
|
}
|
2011-07-20 13:04:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set cookie value to use in next page load
|
|
|
|
* @param string $username username to be set
|
|
|
|
*/
|
2011-09-18 13:05:53 +00:00
|
|
|
public static function setMagicInCookie($username, $token){
|
2011-09-23 11:52:10 +00:00
|
|
|
$secure_cookie = OC_Config::getValue("forcessl", false);
|
|
|
|
setcookie("oc_username", $username, time()+60*60*24*15, '', '', $secure_cookie);
|
|
|
|
setcookie("oc_token", $token, time()+60*60*24*15, '', '', $secure_cookie);
|
|
|
|
setcookie("oc_remember_login", true, time()+60*60*24*15, '', '', $secure_cookie);
|
2011-07-20 13:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Remove cookie for "remember username"
|
|
|
|
*/
|
2011-09-18 13:05:53 +00:00
|
|
|
public static function unsetMagicInCookie(){
|
2011-09-18 07:15:30 +00:00
|
|
|
unset($_COOKIE["oc_username"]);
|
2011-09-18 13:05:53 +00:00
|
|
|
unset($_COOKIE["oc_token"]);
|
2011-09-18 07:15:30 +00:00
|
|
|
unset($_COOKIE["oc_remember_login"]);
|
|
|
|
setcookie("oc_username", NULL, -1);
|
2011-09-18 13:05:53 +00:00
|
|
|
setcookie("oc_token", NULL, -1);
|
2011-09-18 07:15:30 +00:00
|
|
|
setcookie("oc_remember_login", NULL, -1);
|
2011-07-20 13:04:14 +00:00
|
|
|
}
|
2010-04-22 17:03:54 +00:00
|
|
|
}
|