Implement request #301: Create users when using external auth login
After a successful login with imap, smb or ftp, the corresponding user is created in an own database table. This is needed to make e.g. sharing files with this users work. The table may be used by several different external user authentication services. See the discussion in https://github.com/owncloud/apps/pull/1579 for details on the implementation design.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
class OC_User_FTP extends OC_User_Backend{
|
||||
class OC_User_FTP extends OC_User_External_Base{
|
||||
private $host;
|
||||
private $secure;
|
||||
private $protocol;
|
||||
@@ -18,6 +18,7 @@ class OC_User_FTP extends OC_User_Backend{
|
||||
if($this->secure) {
|
||||
$this->protocol.='s';
|
||||
}
|
||||
parent::__construct($this->protocol . '://' . $this->host);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,13 +37,10 @@ class OC_User_FTP extends OC_User_Backend{
|
||||
$url = sprintf('%s://%s:%s@%s/', $this->protocol, $uid, $password, $this->host);
|
||||
$result=@opendir($url);
|
||||
if(is_resource($result)) {
|
||||
$this->storeUser($uid);
|
||||
return $uid;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function userExists($uid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user