[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2584] trunk



Revision: 2584
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2584&view=rev
Author:   einhverfr
Date:     2009-05-01 05:33:20 +0000 (Fri, 01 May 2009)

Log Message:
-----------
Password policies are configurable now

Modified Paths:
--------------
    trunk/LedgerSMB/AM.pm
    trunk/UI/am-defaults.html
    trunk/sql/modules/admin.sql

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2009-05-01 05:02:44 UTC (rev 2583)
+++ trunk/LedgerSMB/AM.pm	2009-05-01 05:33:20 UTC (rev 2584)
@@ -1815,7 +1815,7 @@
         fxgain_accno_id fxloss_accno_id glnumber sinumber vinumber
         sonumber ponumber sqnumber rfqnumber partnumber employeenumber
         customernumber vendornumber projectnumber yearend curr
-        weightunit businessnumber default_country check_prefix)
+        weightunit businessnumber default_country check_prefix password_duration)
       )
     {
         my $val = $form->{$_};

Modified: trunk/UI/am-defaults.html
===================================================================
--- trunk/UI/am-defaults.html	2009-05-01 05:02:44 UTC (rev 2583)
+++ trunk/UI/am-defaults.html	2009-05-01 05:33:20 UTC (rev 2584)
@@ -141,6 +141,10 @@
           <th align="right" nowrap="nowrap"><?lsmb text('Check Prefix') ?></th>
 	  <td><input name="check_prefix" size="40" value="<?lsmb form.check_prefix ?>" /></td>
 	</tr>
+	<tr>
+          <th align="right" nowrap="nowrap"><?lsmb text('Password Duration') ?></th>
+	  <td><input name="password_duration" size="40" value="<?lsmb form.password_duration ?>" /></td>
+	</tr>
       </table>
     </td>
   </tr>

Modified: trunk/sql/modules/admin.sql
===================================================================
--- trunk/sql/modules/admin.sql	2009-05-01 05:02:44 UTC (rev 2583)
+++ trunk/sql/modules/admin.sql	2009-05-01 05:33:20 UTC (rev 2584)
@@ -297,13 +297,13 @@
 
     UPDATE users SET notify_password = DEFAULT where username = SESSION_USER;
 
+    IF t_expires IS NOT NULL THEN
+        t_expires := 'infinity';
+    END IF;
+
     EXECUTE 'ALTER USER ' || quote_ident(SESSION_USER) || 
-            ' with ENCRYPTED password ' || quote_literal(in_new_password);
-
-    IF t_expires IS NOT NULL THEN
-         EXECUTE 'ALTER USER ' || quote_ident(SESSION_USER) ||
+            ' with ENCRYPTED password ' || quote_literal(in_new_password) ||
                  ' VALID UNTIL '|| quote_literal(t_expires);
-    END IF;
     return 1;
 END;
 $$ language plpgsql security definer;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.