Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001225 [SysCP] General trivial always 2009-04-16 23:51 2009-04-17 08:15
Reporter dhr View Status public  
Assigned To Flo
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0001225: on customer creation user home gets saved to mysql with duplicate trailling slash
Description Whenever a customer is created, the home directory gets saved to the ftp_users table with a duplicate trailling slash.

Upon editing, php code adds a trailling slash to the home if the path was entered without. Later on, another one gets appended by the sql query. I suggest to change the latter:

admin_customers.php:675
from


$result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "/', 'y', '" . (int)$guid . "', '" . (int)$guid . "')");



to

$result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')");
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000372)
monotek (reporter)
2009-04-17 07:38

Duplicate:

https://bugs.syscp.org/view.php?id=1019 [^]

-  SVN - commits
(#2710)
flo
2009-04-17 08:14
Removing trailing slash from query in admin_customers where the default ftp user gets added, fixes #1225
U trunk/syscp/admin_customers.php

- Issue History
Date Modified Username Field Change
2009-04-16 23:51 dhr New Issue
2009-04-16 23:51 dhr Issue Monitored: dhr
2009-04-17 07:38 monotek Note Added: 0000372
2009-04-17 08:14 Flo Status new => assigned
2009-04-17 08:14 Flo Assigned To => Flo
2009-04-17 08:14 Flo Checkin
2009-04-17 08:14 Flo Status assigned => resolved
2009-04-17 08:14 Flo Resolution open => fixed
2009-04-17 08:15 Flo Target Version => 1.4.3
2009-04-30 13:27 dhr Issue End Monitor: dhr
Footer