]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
make external auth login work. one thing left is when the user changes his password
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 5 Feb 2010 18:41:43 +0000 (18:41 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 5 Feb 2010 18:41:43 +0000 (18:41 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@628 b3834d28-1941-0410-a4f8-b48e95affb8f

data/config.default.php
src/SemanticScuttle/Service/AuthUser.php

index a6b0e688e0dbcb156d7ede698cdf27263a592af2..1b040c001185bf246bee01f5ee2a28e3ee4fe16c 100644 (file)
@@ -705,4 +705,13 @@ $authOptions = null;
  * @var boolean
  */
 $authDebug = false;
+
+/**
+ * Optional prefix to create email addresses from user names.
+ * i.e. "@example.org" to create "user@example.org" email address
+ * from "user" username.
+ *
+ * @var string
+ */
+$authEmailSuffix = null;
 ?>
index 79cac9c4b068c72b33d913e2b1804ea04feb6c5a..a293af5ef415f68f1f9bfa57bb8b08c2ff261db9 100644 (file)
@@ -155,9 +155,12 @@ class SemanticScuttle_Service_AuthUser extends SemanticScuttle_Service_User
         }
 
         $ok = $this->loginAuth($username, $password);
-        $password = $this->sanitisePassword($password);
-        $id       = $this->getIdFromUser($username);
-        //FIXME: check against auth
+        if (!$ok) {
+            return false;
+        }
+
+        //utilize real login method to get longtime cookie support etc.
+        return parent::login($username, $password, $remember);
     }
 
 
@@ -187,7 +190,7 @@ class SemanticScuttle_Service_AuthUser extends SemanticScuttle_Service_User
         if (!$this->getUserByUsername($username)) {
             $this->addUser(
                 $username, $password,
-                $username . '@' . $GLOBALS['authemaildomain']
+                $username . $GLOBALS['authEmailSuffix']
             );
         }
         //FIXME: what if the user changed his password?