fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9410] registration: username type / configurable loc


From: Sigurd Nes
Subject: [Fmsystem-commits] [9410] registration: username type / configurable location selector
Date: Sat, 19 May 2012 19:38:44 +0000

Revision: 9410
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9410
Author:   sigurdne
Date:     2012-05-19 19:38:43 +0000 (Sat, 19 May 2012)
Log Message:
-----------
registration: username type / configurable location selector

Modified Paths:
--------------
    trunk/registration/inc/class.bomanagefields.inc.php
    trunk/registration/inc/class.bopending.inc.php
    trunk/registration/inc/class.boreg.inc.php
    trunk/registration/inc/class.soreg.inc.php
    trunk/registration/inc/class.uireg.inc.php
    trunk/registration/js/portico/ajax.js
    trunk/registration/setup/default_records.inc.php
    trunk/registration/setup/phpgw_no.lang
    trunk/registration/setup/setup.inc.php
    trunk/registration/setup/tables_update.inc.php
    trunk/registration/templates/base/personal_info.tpl

Added Paths:
-----------
    trunk/registration/inc/class.hook_helper.inc.php

Modified: trunk/registration/inc/class.bomanagefields.inc.php
===================================================================
--- trunk/registration/inc/class.bomanagefields.inc.php 2012-05-16 10:25:13 UTC 
(rev 9409)
+++ trunk/registration/inc/class.bomanagefields.inc.php 2012-05-19 19:38:43 UTC 
(rev 9410)
@@ -82,6 +82,8 @@
                                                if($suffix && 
$field_info['field_type'] == 'location' && !is_array 
($current_fields[$field_info['field_name']]))
                                                {
                                                        
$field_info['field_name'] = rtrim($transform_name,'1') . $suffix;
+                                                       $_child_level = $suffix 
+1;
+                                                       
$field_info['field_values'] = 
"{$_child_level}::loc{$_child_level}_name::loc{$suffix}_name";
                                                }
                                                else if($suffix && 
$field_info['field_type'] == 'location' && is_array 
($current_fields[$field_info['field_name']]))
                                                {

Modified: trunk/registration/inc/class.bopending.inc.php
===================================================================
--- trunk/registration/inc/class.bopending.inc.php      2012-05-16 10:25:13 UTC 
(rev 9409)
+++ trunk/registration/inc/class.bopending.inc.php      2012-05-19 19:38:43 UTC 
(rev 9410)
@@ -218,7 +218,7 @@
                                        continue;
                                }
 
-                               $file = PHPGW_SERVER_ROOT . 
"/property/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+                               $file = PHPGW_SERVER_ROOT . 
"/registration/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
                                if ( $entry['active'] && is_file($file) )
                                {
                                        require_once $file;
@@ -349,7 +349,7 @@
                                        continue;
                                }
 
-                               $file = PHPGW_SERVER_ROOT . 
"/property/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+                               $file = PHPGW_SERVER_ROOT . 
"/registration/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
                                if ( $entry['active'] && is_file($file) )
                                {
                                        require_once $file;

Modified: trunk/registration/inc/class.boreg.inc.php
===================================================================
--- trunk/registration/inc/class.boreg.inc.php  2012-05-16 10:25:13 UTC (rev 
9409)
+++ trunk/registration/inc/class.boreg.inc.php  2012-05-19 19:38:43 UTC (rev 
9410)
@@ -77,7 +77,20 @@
 
                function step2()
                {
-
+                       $ui = createobject('registration.uireg');
+                       if(!$r_reg = phpgw::get_var('r_reg'))
+                       {
+                               $r_reg = array();
+                       }
+                       if(!$o_reg = phpgw::get_var('o_reg'))
+                       {
+                               $o_reg = array();
+                       }
+                       $fields = array();
+                       $errors = array();
+//             _debug_array($r_reg);
+                       
+//-------
                        if($this->config['username_is'] == 'email')
                        {
                                $this->fields['loginid'] = array
@@ -89,20 +102,33 @@
                            'field_required' => 'Y',
                            'field_order' => 1
                                );
-                       }
 
-                       $ui = createobject('registration.uireg');
-                       if(!$r_reg = phpgw::get_var('r_reg'))
-                       {
-                               $r_reg = array();
+                               if (! $r_reg['loginid'])
+                               {
+                                       $missing_fields[] = 'loginid';
+                                       $errors[] = lang('you must enter a 
username');
+                               }
+                               else
+                               {
+                                       $loginid = 
$GLOBALS['phpgw']->session->appsession('loginid','registration');
+                                       
+                                       if($r_reg['loginid'] != $loginid)
+                                       {
+                                               
$GLOBALS['phpgw']->session->appsession('loginid','registration',$r_reg['loginid']);
+                                               $loginid = false;
+                                       }
+
+                                       if( !$loginid )
+                                       {
+                                               if( 
execMethod('registration.soreg.account_exists', $r_reg['loginid']))
+                                               {
+                                                       $errors[] = 
lang('Sorry, that username is already taken.');                                 
            
+                                               }
+                                       }
+                               }
                        }
-                       if(!$o_reg = phpgw::get_var('o_reg'))
-                       {
-                               $o_reg = array();
-                       }
-                       $fields = array();
 
-                       //echo '<pre>'; print_r($r_reg); echo '</pre>';
+//--------
 
                        if ($this->config['password_is'] == 'http')
                        {
@@ -220,14 +246,13 @@
                                }
                        }
 
-                       while (is_array($o_reg) && list($name,$value) = 
each($o_reg))
-                       {
-                               $fields[$name] = $value;
-                       }
-
                        if (is_array ($o_reg))
                        {
                                reset($o_reg);
+                               foreach ($o_reg as $name => $value)
+                               {
+                                       $fields[$name] = $value;
+                               }
                        }
 
                        if (is_array($missing_fields))
@@ -235,19 +260,19 @@
                                $errors[] = lang('You must fill in all of the 
required fields');
                        }
 
-                       if (! is_array($errors))
+                       if (! $errors)
                        {
                                $so     = createobject('registration.soreg');
                                $reg_id = $so->step2($fields);
                        }
 
-
-                       if (is_array($errors))
+                       if ($errors)
                        {
                                
$ui->step2($errors,$r_reg,$o_reg,$missing_fields);
                        }
                        else
                        {
+                               
$GLOBALS['phpgw']->session->appsession('loginid','registration','');
                                // Redirect them so they don't hit refresh and 
make a mess
                                
$GLOBALS['phpgw']->redirect_link('/registration/main.php',array('menuaction' => 
'registration.uireg.ready_to_activate', 'reg_id' => $reg_id, 'logindomain' => 
$_REQUEST['logindomain']));
                        }
@@ -432,6 +457,10 @@
                        {
                                return True;
                        }
+                       else if ($this->config['password_is'] == 'email')
+                       {
+                               return True;
+                       }
                        elseif ($this->config['password_is'] == 'http')
                        {
                                if (!$_SERVER['PHP_AUTH_PW'])
@@ -450,14 +479,26 @@
                function get_locations()
                {
                        $location_code = phpgw::get_var('location_code');
-
-                       $locations = 
execMethod('property.solocation.get_children', $location_code);
-
-                       if(!$location_code)
+                       $field = phpgw::get_var('field');
+                       if($field)
                        {
-                               array_push($locations, array('id' => '', 'name' 
=> lang('select')));
+                               $field_info_arr = explode('::', 
$this->fields[$field]['field_values']);
                        }
 
-                       return $locations;
+                       $criteria = array
+                       (
+                               'location_code' => $location_code,
+                               'child_level'   => $field_info_arr[0],
+                               'field_name'    => $field_info_arr[1]
+                       );
+       
+                       $locations = 
execMethod('property.solocation.get_children',$criteria);
+                       $values = array
+                       (
+                               'child_level'   => $field_info_arr[0],
+                               'locations'             => $locations
+                       );
+
+                       return $values;
                }
        }

Added: trunk/registration/inc/class.hook_helper.inc.php
===================================================================
--- trunk/registration/inc/class.hook_helper.inc.php                            
(rev 0)
+++ trunk/registration/inc/class.hook_helper.inc.php    2012-05-19 19:38:43 UTC 
(rev 9410)
@@ -0,0 +1,56 @@
+<?php
+       /**
+        * registration - Hook helper
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @package registration
+        * @version $Id: class.hook_helper.inc.php 9104 2012-04-04 09:47:47Z 
sigurdne $
+        */
+
+       /*
+          This program is free software: you can redistribute it and/or modify
+          it under the terms of the GNU General Public License as published by
+          the Free Software Foundation, either version 2 of the License, or
+          (at your option) any later version.
+
+          This program is distributed in the hope that it will be useful,
+          but WITHOUT ANY WARRANTY; without even the implied warranty of
+          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+          GNU General Public License for more details.
+
+          You should have received a copy of the GNU General Public License
+          along with this program.  If not, see <http://www.gnu.org/licenses/>.
+        */
+
+
+       /**
+        * Hook helper
+        *
+        * @package registration
+        */
+       class registration_hook_helper
+       {
+               /**
+                * Clear reg_accounts either as part of a cron-job or logout 
hook
+                *
+                * @return void
+                */
+               public function clear_reg_accounts()
+               {
+                       $c = createobject('phpgwapi.config','registration');
+                       $c->read();
+
+                       if($c->config_data['activate_account'] == 
'pending_approval')
+                       {
+                               $GLOBALS['phpgw']->db->query("DELETE FROM 
phpgw_reg_accounts WHERE reg_dla <= '"
+                               . (time() - 7200) . "' AND reg_info IS 
NULL",__LINE__,__FILE__);        
+                       }
+                       else
+                       {
+                               $GLOBALS['phpgw']->db->query("DELETE FROM 
phpgw_reg_accounts WHERE reg_dla <= '"
+                               . (time() - 7200) . "'",__LINE__,__FILE__);
+                       }
+               }
+       }

Modified: trunk/registration/inc/class.soreg.inc.php
===================================================================
--- trunk/registration/inc/class.soreg.inc.php  2012-05-16 10:25:13 UTC (rev 
9409)
+++ trunk/registration/inc/class.soreg.inc.php  2012-05-19 19:38:43 UTC (rev 
9410)
@@ -60,19 +60,17 @@
                        $this->reg_id = md5(time() . $account_lid . 
$GLOBALS['phpgw']->common->randomstring(32));
                        $account_lid  = 
$GLOBALS['phpgw']->session->appsession('loginid','registration');
 
-                       $location = array();
-
-                       for ($i=1; $i<=6; $i++)
+                       for ($i=1; $i < 10; $i++)
                        {
                                if (isset($fields["loc{$i}"]) && 
$fields["loc{$i}"])
                                {
-                                       $location[] = $fields["loc{$i}"];
+                                       $fields['location_code'] = 
$fields["loc{$i}"];
                                }
                        }
 
-                       if($location)
+                       if($this->config['username_is'] == 'email')
                        {
-                               $fields['location_code'] = implode('-', 
$location);
+                               $fields['email'] = $fields['loginid'];
                        }
 
                        $this->db->query("UPDATE phpgw_reg_accounts SET 
reg_id='" . $this->reg_id . "', reg_dla='"
@@ -445,7 +443,9 @@
                                        'location'      => 'registration',
                                        'location_code' => 
$fields['location_code'],
                                        'contact_id'    => 
$GLOBALS['phpgw']->accounts->get($account_id)->person_id,
-                                       'account_lid'   => $account_lid
+                                       'account_lid'   => $account_lid,
+                                       'account_id'    => $account_id,
+                                       'email'                 => 
$fields['email']
                                );
 
                                $GLOBALS['phpgw']->hooks->single($args, 
'property');

Modified: trunk/registration/inc/class.uireg.inc.php
===================================================================
--- trunk/registration/inc/class.uireg.inc.php  2012-05-16 10:25:13 UTC (rev 
9409)
+++ trunk/registration/inc/class.uireg.inc.php  2012-05-19 19:38:43 UTC (rev 
9410)
@@ -25,6 +25,7 @@
        {
                var $template;
                var $bomanagefields;
+               var $first_location = false;
                var $fields;
                var $bo;
                var $config;
@@ -229,16 +230,10 @@
 //----
                        if($this->config['username_is'] == 'email')
                        {
-
+                               
$this->template->set_var('message',lang('username as email'));
                                $username_fields = $this->get_username_fields();
                                $username_fields['lang_username'] = '<b>' . 
lang('username') . '</b>';
-                               $username_fields['value_username'] = 
'test';//$loginid;
-
-//                                     $missing['loginid'] = true;
-//                                     $username_fields['missing_loginid'] = 
'<font color="#CC0000">*</font>';
-//                                     $username_fields['value_username'] = 
'test';//$loginid;
-//                                     $errors[] = lang('you must enter a 
username');
-
+                               $username_fields['value_username'] = 
$GLOBALS['phpgw']->session->appsession('loginid','registration');
                                $this->template->set_var($username_fields);
                        }
                        else
@@ -257,9 +252,6 @@
                        
$this->template->set_var('lang_reenter_password',lang('Re-enter password'));
                        $this->template->set_var('lang_submit',lang('Submit'));
 
-
-
-
                        if (!$show_password_prompt)
                        {
                                $this->template->set_block ('form', 'password', 
'empty');
@@ -487,9 +479,17 @@
                                $rstring = <<<HTML
                                <select id="{$name}" name="{$a}[{$name}]">
 HTML;
-                               if($name == 'loc1')
+                               if(!$this->first_location)
                                {
-                                       $locations = 
execMethod('property.solocation.get_children');
+                                       $field_info_arr = explode('::', 
$this->fields[$name]['field_values']);
+                                       $criteria = array
+                                       (
+                                               'location_code' => 
'',//$location_code,
+                                               'child_level'   => (int) 
ltrim($name, 'loc'),
+                                               'field_name'    => 
isset($field_info_arr[2]) && $field_info_arr[2] ? $field_info_arr[2] : 
"{$name}_name"
+                                       );
+
+                                       $locations = 
execMethod('property.solocation.get_children',$criteria);
                                        array_unshift($locations, array('id' => 
'', 'name' => lang('select')));
 
                                        foreach ($locations as $location)
@@ -505,6 +505,7 @@
                                </select>
 HTML;
                                }
+                               $this->first_location = true;
                        }
 
                        return $rstring;

Modified: trunk/registration/js/portico/ajax.js
===================================================================
--- trunk/registration/js/portico/ajax.js       2012-05-16 10:25:13 UTC (rev 
9409)
+++ trunk/registration/js/portico/ajax.js       2012-05-19 19:38:43 UTC (rev 
9410)
@@ -1,19 +1,15 @@
 $(document).ready(function(){
-       
+
        $("#loc1").change(function () {
-               var loc1 = $(this).val();
-               $("#loc2").html( "<option></option>" );
-               $("#loc3").html( "<option></option>" );
-               $("#loc4").html( "<option></option>" );
-               $("#loc5").html( "<option></option>" );
 
-               if(!loc1)
+               if(!$(this).val())
                {
                        return false;
                }
-               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:loc1};
+
+               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:$(this).val(), field: 'loc1'};
                var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
-      
+
                var htmlString = "";
 
                $.ajax({
@@ -23,39 +19,33 @@
                        success: function(data) {
                                if( data != null)
                                {
-                                       htmlString  = "<option value = ''>" + 
data.length + " lokasjone(r) funnet</option>"
-                                       var obj = data;
-
+                                       var obj = data.locations;
+                                       htmlString  = "<option value = ''>" + 
obj.length + " lokasjone(r) funnet</option>"
                                        $.each(obj, function(i) {
-                                               htmlString  += "<option 
value='" + obj[i].id + "'>" + obj[i].name + "</option>";
+                                               htmlString  += "<option 
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
                                        });
 
-                                       $("#loc2").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
                                else
                                {
                                        htmlString  += "<option>Ingen 
lokasjoner</option>"
-                                       $("#loc2").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
-                       } 
-               });     
+                       }
+               });
     });
-       
+
        $("#loc2").change(function () {
-               var loc1 = $("#loc1").val();
-               var loc2 = $(this).val();
-               $("#loc3").html( "<option></option>" );
-               $("#loc4").html( "<option></option>" );
-               $("#loc5").html( "<option></option>" );
 
-               if(!loc2)
+               if(!$(this).val())
                {
                        return false;
                }
 
-               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:loc1 + "-" + loc2};
+               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:$(this).val(), field: 'loc2'};
                var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
-      
+
                var htmlString = "";
 
                $.ajax({
@@ -65,37 +55,33 @@
                        success: function(data) {
                                if( data != null)
                                {
-                                       htmlString  = "<option value = ''>" + 
data.length + " lokasjone(r) funnet</option>"
-                                       var obj = data;
+                                       var obj = data.locations;
+                                       htmlString  = "<option value = ''>" + 
obj.length + " lokasjone(r) funnet</option>"
                                        $.each(obj, function(i) {
                                                htmlString  += "<option 
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
                                        });
 
-                                       $("#loc3").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
                                else
                                {
                                        htmlString  += "<option>Ingen 
lokasjoner</option>"
-                                       $("#loc3").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
-                       } 
-               });     
+                       }
+               });
     });
 
        $("#loc3").change(function () {
-               var loc1 = $("#loc1").val();
-               var loc2 = $("#loc2").val();
-               var loc3 = $(this).val();
-               $("#loc4").html( "<option></option>" );
-               $("#loc5").html( "<option></option>" );
 
-               if(!loc3)
+               if(!$(this).val())
                {
                        return false;
                }
-               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:loc1 + "-" + loc2 + "-" + loc3};
+
+               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:$(this).val(), field: 'loc3'};
                var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
-      
+
                var htmlString = "";
 
                $.ajax({
@@ -105,37 +91,33 @@
                        success: function(data) {
                                if( data != null)
                                {
-                                       htmlString  = "<option value = ''>" + 
data.length + " lokasjone(r) funnet</option>"
-                                       var obj = data;
+                                       var obj = data.locations;
+                                       htmlString  = "<option value = ''>" + 
obj.length + " lokasjone(r) funnet</option>"
                                        $.each(obj, function(i) {
                                                htmlString  += "<option 
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
                                        });
 
-                                       $("#loc4").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
                                else
                                {
                                        htmlString  += "<option>Ingen 
lokasjoner</option>"
-                                       $("#loc4").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
-                       } 
-               });     
+                       }
+               });
     });
 
        $("#loc4").change(function () {
-               var loc1 = $("#loc1").val();
-               var loc2 = $("#loc2").val();
-               var loc3 = $("#loc3").val();
-               var loc4 = $(this).val();
-               $("#loc5").html( "<option></option>" );
-               if(!loc4)
+
+               if(!$(this).val())
                {
                        return false;
                }
 
-               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:loc1 + "-" + loc2 + "-" + loc3 + "-" + loc4};
+               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:$(this).val(), field: 'loc4'};
                var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
-      
+
                var htmlString = "";
 
                $.ajax({
@@ -145,38 +127,33 @@
                        success: function(data) {
                                if( data != null)
                                {
-                                       htmlString  = "<option value = ''>" + 
data.length + " lokasjone(r) funnet</option>"
-                                       var obj = data;
+                                       var obj = data.locations;
+                                       htmlString  = "<option value = ''>" + 
obj.length + " lokasjone(r) funnet</option>"
                                        $.each(obj, function(i) {
                                                htmlString  += "<option 
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
                                        });
 
-                                       $("#loc5").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
                                else
                                {
                                        htmlString  += "<option>Ingen 
lokasjoner</option>"
-                                       $("#loc5").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
-                       } 
-               });     
+                       }
+               });
     });
 
        $("#loc5").change(function () {
-               var loc1 = $("#loc1").val();
-               var loc2 = $("#loc2").val();
-               var loc3 = $("#loc3").val();
-               var loc4 = $("#loc4").val();
-               var loc5 = $(this).val();
-               $("#loc6").html( "<option></option>" );
-               if(!loc5)
+
+               if(!$(this).val())
                {
                        return false;
                }
 
-               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:loc1 + "-" + loc2 + "-" + loc3 + "-" + loc4 + "-" + loc5};
+               var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:$(this).val(), field: 'loc5'};
                var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
-      
+
                var htmlString = "";
 
                $.ajax({
@@ -186,21 +163,21 @@
                        success: function(data) {
                                if( data != null)
                                {
-                                       htmlString  = "<option value = ''>" + 
data.length + " lokasjone(r) funnet</option>"
-                                       var obj = data;
+                                       var obj = data.locations;
+                                       htmlString  = "<option value = ''>" + 
obj.length + " lokasjone(r) funnet</option>"
                                        $.each(obj, function(i) {
                                                htmlString  += "<option 
value='" + obj[i].id + "'>"+ obj[i].name + "</option>";
                                        });
 
-                                       $("#loc6").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
                                else
                                {
                                        htmlString  += "<option>Ingen 
lokasjoner</option>"
-                                       $("#loc6").html( htmlString );
+                                       $("#loc" + data.child_level).html( 
htmlString );
                                }
-                       } 
-               });     
+                       }
+               });
     });
 /*
 
@@ -211,7 +188,7 @@
                var loc_arr = loc_id.split('_');
                var loc_level = parseInt(loc_arr[1]);
                var new_loc_id = "loc_" + (parseInt(loc_level)+1);
-               
+
                var id = "";
                var new_loc_code = "";
                var level;
@@ -222,14 +199,14 @@
                        else
                                new_loc_code += $("#" + id).val();
                }
-               
+
                if(!loc_code)
                {
                        return false;
                }
                var oArgs = {menuaction:'registration.boreg.get_locations', 
location_code:new_loc_code};
                var requestUrl = phpGWLink('registration/main.php', oArgs, 
true);
-      
+
                var htmlString = "";
 
                $.ajax({
@@ -241,8 +218,8 @@
                                {
                                        htmlString  = "<select 
class='choose_loc' name='" + new_loc_id  + "' id='" + new_loc_id  + "' >" +
                                                                  "<option 
value = ''>" + data.length + " lokasjone(r) funnet</option>";
-                                                                 
-                                                                 
+
+
                                        var obj = data;
 
                                        $.each(obj, function(i) {
@@ -250,7 +227,7 @@
                                        });
 
                                        htmlString += "</select>";
-                                       
+
                                        $(thisSelectBox).after( htmlString );
                                }
                                else
@@ -258,8 +235,8 @@
                                        htmlString  += "<option>Ingen 
lokasjoner</option>"
                                        $(new_loc_id).html( htmlString );
                                }
-                       } 
-               });     
+                       }
+               });
     });
 
 */

Modified: trunk/registration/setup/default_records.inc.php
===================================================================
--- trunk/registration/setup/default_records.inc.php    2012-05-16 10:25:13 UTC 
(rev 9409)
+++ trunk/registration/setup/default_records.inc.php    2012-05-19 19:38:43 UTC 
(rev 9410)
@@ -26,3 +26,11 @@
        $GLOBALS['phpgw_setup']->oProc->query ("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES 
('registration','activate_account','email')");
        $GLOBALS['phpgw_setup']->oProc->query ("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES 
('registration','username_is','choice')");
        $GLOBALS['phpgw_setup']->oProc->query ("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES 
('registration','password_is','choice')");
+
+       $asyncservice = CreateObject('phpgwapi.asyncservice');
+       $asyncservice->set_timer(
+               array('hour' => "*/2"),
+               'registration_clear_reg_accounts',
+               'registration.hook_helper.clear_reg_accounts',
+               null
+       );

Modified: trunk/registration/setup/phpgw_no.lang
===================================================================
--- trunk/registration/setup/phpgw_no.lang      2012-05-16 10:25:13 UTC (rev 
9409)
+++ trunk/registration/setup/phpgw_no.lang      2012-05-19 19:38:43 UTC (rev 
9410)
@@ -32,6 +32,7 @@
 type   registration    no      Type
 update/add     registration    no      Oppdater/Legg til
 Username       registration    no      Brukernavn
+username as email      registration    no      Angi epost som brukernavn
 values (for dropdown only; comma separated)    registration    no      Verdi 
(bare for Dropdown; comma separert)
 wrong session  registration    no      Feil session
 you have entered an invalid birthday   registration    no      Du har angitt 
en ugyldig fødselsdag

Modified: trunk/registration/setup/setup.inc.php
===================================================================
--- trunk/registration/setup/setup.inc.php      2012-05-16 10:25:13 UTC (rev 
9409)
+++ trunk/registration/setup/setup.inc.php      2012-05-19 19:38:43 UTC (rev 
9410)
@@ -16,7 +16,7 @@
 
        /* Basic information about this app */
        $setup_info['registration']['name']                     = 
'registration';
-       $setup_info['registration']['version']          = '0.8.4';
+       $setup_info['registration']['version']          = '0.8.5';
        $setup_info['registration']['app_order']        = '90';
        $setup_info['registration']['enable']           = 2;
        $setup_info['registration']['app_group']        = 'other';
@@ -32,7 +32,7 @@
        (
                'menu'          => 'registration.menu.get_menu',
                'config',
-               'logout'
+               'logout'        => 'registration.hook_helper.clear_reg_accounts'
        );
 
 

Modified: trunk/registration/setup/tables_update.inc.php
===================================================================
--- trunk/registration/setup/tables_update.inc.php      2012-05-16 10:25:13 UTC 
(rev 9409)
+++ trunk/registration/setup/tables_update.inc.php      2012-05-19 19:38:43 UTC 
(rev 9410)
@@ -59,4 +59,25 @@
                        $GLOBALS['setup_info']['registration']['currentver'] = 
'0.8.4';
                        return 
$GLOBALS['setup_info']['registration']['currentver'];
                }
-       }       
+       }
+
+       $test[] = '0.8.4';
+       function registration_upgrade0_8_4()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $asyncservice = CreateObject('phpgwapi.asyncservice');
+               $asyncservice->set_timer(
+                       array('hour' => "*/2"),
+                       'registration_clear_reg_accounts',
+                       'registration.hook_helper.clear_reg_accounts',
+                       null
+                       );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['registration']['currentver'] = 
'0.8.5';
+                       return 
$GLOBALS['setup_info']['registration']['currentver'];
+               }
+       }
+

Modified: trunk/registration/templates/base/personal_info.tpl
===================================================================
--- trunk/registration/templates/base/personal_info.tpl 2012-05-16 10:25:13 UTC 
(rev 9409)
+++ trunk/registration/templates/base/personal_info.tpl 2012-05-19 19:38:43 UTC 
(rev 9410)
@@ -42,6 +42,7 @@
 {javascript}
 
 
+<center>{message}</center>
 <center>{errors}</center>
 <form action="{form_action}" method="POST">
  <table border="0" width="75%" align="center">




reply via email to

[Prev in Thread] Current Thread [Next in Thread]