Fix coding style according to owncloud/build/phpcs.xml

This commit is contained in:
Christian Weiske
2014-02-05 18:20:11 +01:00
parent 7bfe3c269c
commit fa6b4c1144
4 changed files with 129 additions and 50 deletions

View File

@@ -6,11 +6,26 @@
* See the COPYING-README file.
*/
/**
* User authentication against a FTP/FTPS server
*
* @category Apps
* @package UserExternal
* @author Robin Appelman <icewind@owncloud.com>
* @license http://www.gnu.org/licenses/agpl AGPL
* @link http://github.com/owncloud/apps
*/
class OC_User_FTP extends \OCA\user_external\Base{
private $host;
private $secure;
private $protocol;
/**
* Create new FTP authentication provider
*
* @param string $host Hostname or IP of FTP server
* @param boolean $secure TRUE to enable SSL
*/
public function __construct($host,$secure=false) {
$this->host=$host;
$this->secure=$secure;
@@ -22,16 +37,19 @@ class OC_User_FTP extends \OCA\user_external\Base{
}
/**
* @brief Check if the password is correct
* @param $uid The username
* @param $password The password
* @returns true/false
*
* Check if the password is correct without logging in the user
*
* @param string $uid The username
* @param string $password The password
*
* @return true/false
*/
public function checkPassword($uid, $password) {
if (false === array_search($this->protocol, stream_get_wrappers())) {
OCP\Util::writeLog('user_external', 'ERROR: Stream wrapper not available: ' . $this->protocol, OCP\Util::ERROR);
OCP\Util::writeLog(
'user_external',
'ERROR: Stream wrapper not available: ' . $this->protocol, OCP\Util::ERROR
);
return false;
}
$url = sprintf('%s://%s:%s@%s/', $this->protocol, $uid, $password, $this->host);