Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql hashed passwords for FTP user #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/ftp_management/code/controller.ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ static function ExecuteResetPassword($ft_id_pk, $password)
$rowftp = $rowftpfind->fetch();

$sql = $zdbh->prepare("UPDATE x_ftpaccounts SET ft_password_vc=:password WHERE ft_id_pk=:ftpid");
$password= hash(’sha512′,$password);
$sql->bindParam(':password', $password);
$sql->bindParam(':ftpid', $ft_id_pk);
$sql->execute();
Expand Down Expand Up @@ -213,6 +214,7 @@ static function ExecuteCreateFTP($uid, $username, $password, $destination, $doma
}

$sql = $zdbh->prepare("INSERT INTO x_ftpaccounts (ft_acc_fk, ft_user_vc, ft_directory_vc, ft_access_vc, ft_password_vc, ft_created_ts) VALUES (:userid, :username, :homedir, :accesstype, :password, :time)");
$password= hash(’sha512′,$password);
$sql->bindParam(':userid', $currentuser['userid']);
$sql->bindParam(':username', $username);
$sql->bindParam(':homedir', $homedirectory_to_use);
Expand Down