From ba6f56e09a7e7f7dd0317f28533268189a7f445c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 23 Apr 2004 15:34:22 +0000 Subject: [PATCH] use same regex for Samba profile path --- lam-0.4/templates/account/useredit.php | 2 +- lam-0.4/templates/profedit/profilecreate.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lam-0.4/templates/account/useredit.php b/lam-0.4/templates/account/useredit.php index 2a5deda5..839f3853 100644 --- a/lam-0.4/templates/account/useredit.php +++ b/lam-0.4/templates/account/useredit.php @@ -443,7 +443,7 @@ switch ($_POST['select']) { if ( (!$account_new->smb_scriptPath=='') && (!eregi('^([\\])*([a-z0-9\\._%äöüß-])+(\\\([a-z0-9\\._%äöüß-])+)*((\.bat)|(\.cmd))$', $account_new->smb_scriptPath))) $errors[] = array('ERROR', _('Logon script'), _('Logon script is invalid!')); if ( (!$account_new->smb_profilePath=='') && (!eregi('^[/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*)*$', $account_new->smb_profilePath)) - && (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+)+$', $account_new->smb_profilePath))) + && (!eregi('^[\][\]([a-z0-9_]|[.]|[-]|[%])+([\]([a-z0-9_]|[.]|[-]|[%])+)+$', $account_new->smb_profilePath))) $errors[] = array('ERROR', _('Profile path'), _('Profile path is invalid!')); if ((!$account_new->smb_domain=='') && (!is_object($account_new->smb_domain)) && !ereg('^([a-z]|[A-Z]|[0-9]|[-])+$', $account_new->smb_domain)) $errors[] = array('ERROR', _('Domain name'), _('Domain name contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and -.')); diff --git a/lam-0.4/templates/profedit/profilecreate.php b/lam-0.4/templates/profedit/profilecreate.php index 4c622f9b..cafb2076 100644 --- a/lam-0.4/templates/profedit/profilecreate.php +++ b/lam-0.4/templates/profedit/profilecreate.php @@ -198,7 +198,8 @@ if ($_GET['type'] == "user") { exit; } if (get_magic_quotes_gpc() == 1) $_POST['smb_profilepath'] = stripslashes($_POST['smb_profilepath']); - if ($_POST['smb_profilepath'] && eregi("^[\][\]([a-z0-9])+([\][a-z0-9_\\-\\$%]+)+$", $_POST['smb_profilepath'])) { + if ($_POST['smb_profilepath'] && (eregi("^[\][\]([a-z0-9])+([\][a-z0-9_\\-\\$%]+)+$", $_POST['smb_profilepath']) || + eregi('^[/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*)*$', $_POST['smb_profilepath']))) { $acct->smb_profilePath = $_POST['smb_profilepath']; } elseif ($_POST['smb_profilepath']) {