thumb: move imagemagick execution to separate function
[minimedit.git] / auth.inc.php
index 4916ab133f3174f451c8a99ebccbadc778863b1f..030a394e0b7904db90320b5643d5f274ddbeda4f 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+date_default_timezone_set('Europe/Amsterdam');
+
 function login_password_verify($input, $test)
 {
        if (substr($test, 0, 1) != '$') {
@@ -22,7 +24,7 @@ function login($inuser, $inpass = NULL)
        }
 
        # find password data by user name
-       $userdir = 'profile/'.strtolower($inuser);
+       $userdir = 'profile/'.preg_replace('/[^a-z0-9]+/', '-', strtolower($inuser));
        $pwfile = "$userdir/.passwd";
        if (!file_exists($pwfile)) return;
        $usertest = trim(file_get_contents($pwfile));