fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9086] registration


From: Sigurd Nes
Subject: [Fmsystem-commits] [9086] registration
Date: Mon, 02 Apr 2012 13:48:46 +0000

Revision: 9086
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9086
Author:   sigurdne
Date:     2012-04-02 13:48:46 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
registration

Modified Paths:
--------------
    trunk/registration/inc/class.bopending.inc.php
    trunk/registration/inc/class.boreg.inc.php
    trunk/registration/inc/class.sopending.inc.php
    trunk/registration/inc/class.soreg.inc.php
    trunk/registration/inc/class.uipending.inc.php
    trunk/registration/inc/class.uireg.inc.php
    trunk/registration/templates/base/config.tpl
    trunk/registration/templates/base/pending_users.xsl
    trunk/registration/templates/base/user_edit.xsl

Added Paths:
-----------
    trunk/registration/templates/base/confirm_pending_approval.tpl

Modified: trunk/registration/inc/class.bopending.inc.php
===================================================================
--- trunk/registration/inc/class.bopending.inc.php      2012-03-29 19:03:08 UTC 
(rev 9085)
+++ trunk/registration/inc/class.bopending.inc.php      2012-04-02 13:48:46 UTC 
(rev 9086)
@@ -227,7 +227,20 @@
 
                        return $receipt;
                }
+
                /**
+                * Process a list of pending and approved users
+                *
+                * @param array   $values  the array users to process
+                *
+                * @return array receipt
+                */
+
+               function process_users($values)
+               {
+               }
+
+               /**
                 * Edit single user
                 *
                 * @param array   $values  the array of values to edit

Modified: trunk/registration/inc/class.boreg.inc.php
===================================================================
--- trunk/registration/inc/class.boreg.inc.php  2012-03-29 19:03:08 UTC (rev 
9085)
+++ trunk/registration/inc/class.boreg.inc.php  2012-04-02 13:48:46 UTC (rev 
9086)
@@ -236,7 +236,6 @@
 
                function step4()
                {
-//                     global $reg_id;
                        $reg_id = phpgw::get_var('reg_id');
                        $so = createobject('registration.soreg');
                        $ui = createobject('registration.uireg');

Modified: trunk/registration/inc/class.sopending.inc.php
===================================================================
--- trunk/registration/inc/class.sopending.inc.php      2012-03-29 19:03:08 UTC 
(rev 9085)
+++ trunk/registration/inc/class.sopending.inc.php      2012-04-02 13:48:46 UTC 
(rev 9086)
@@ -163,9 +163,14 @@
 
                public function update_pending_user($values)
                {
+                       if(!isset($values['id']) || !$values['id'])
+                       {
+                               throw new 
Exception("registration_sopending::update_pending_user() - missing 'id' in 
valueset");
+                       }
+
                        $ret = false;
                        $this->db->transaction_begin();
-                       if (isset($values['location']) && $values['location'] 
&& $values['id'])
+                       if (isset($values['location']) && $values['location'])
                        {
                                $this->db->query("SELECT reg_info FROM 
phpgw_reg_accounts WHERE reg_id = '{$values['id']}'",__LINE__,__FILE__);
                                if ($this->db->next_record())
@@ -173,10 +178,14 @@
                                        $reg_info = 
unserialize(base64_decode($this->db->f('reg_info')));
                                        $reg_info['location_code'] = 
implode('-', $values['location']);
                                }
-                               $ret = $this->db->query("UPDATE 
phpgw_reg_accounts SET  reg_info='" . base64_encode(serialize($reg_info)) . "' 
WHERE reg_id='{$values['id']}'",__LINE__,__FILE__);
+                               $this->db->query("UPDATE phpgw_reg_accounts SET 
 reg_info='" . base64_encode(serialize($reg_info)) . "' WHERE 
reg_id='{$values['id']}'",__LINE__,__FILE__);
                        }
+
+                       $value_set['reg_approved']      = $values['approve'];
+                       $value_set                                      = 
$this->db->validate_update($value_set);
+                       $ret = $this->db->query("UPDATE phpgw_reg_accounts SET 
$value_set WHERE reg_id='{$values['id']}'",__LINE__,__FILE__);
+
                        $this->db->transaction_commit();
                        return $ret;
                }
-
        }

Modified: trunk/registration/inc/class.soreg.inc.php
===================================================================
--- trunk/registration/inc/class.soreg.inc.php  2012-03-29 19:03:08 UTC (rev 
9085)
+++ trunk/registration/inc/class.soreg.inc.php  2012-04-02 13:48:46 UTC (rev 
9086)
@@ -57,8 +57,6 @@
 
                function step2($fields)
                {
-                       $smtp = createobject('phpgwapi.send');
-
                        $this->reg_id = md5(time() . $account_lid . 
$GLOBALS['phpgw']->common->randomstring(32));
                        $account_lid  = 
$GLOBALS['phpgw']->session->appsession('loginid','registration');
 
@@ -66,6 +64,14 @@
                                . time() . "', reg_info='" . 
base64_encode(serialize($fields))
                                . "' WHERE 
reg_lid='$account_lid'",__LINE__,__FILE__);
 
+
+                       if ($this->config['activate_account'] == 
'pending_approval')
+                       {
+                               return $this->reg_id;
+                       }
+
+                       $smtp = createobject('phpgwapi.send');
+
                        $GLOBALS['phpgw']->template->set_file(array(
                                'message' => 'confirm_email.tpl'
                        ));
@@ -345,9 +351,12 @@
                        $GLOBALS['phpgw']->accounts->account = $account;
                        $GLOBALS['phpgw']->accounts->save_repository();
 
-                       if(@stat(PHPGW_SERVER_ROOT . 
'/messenger/inc/hook_registration.inc.php'))
+                       if(isset($this->config['messenger_welcome_message']) && 
$this->config['messenger_welcome_message'] && 
isset($GLOBALS['phpgw_info']['apps']['messenger']))
                        {
-                               include(PHPGW_SERVER_ROOT . 
'/messenger/inc/hook_registration.inc.php');
+                               if(@stat(PHPGW_SERVER_ROOT . 
'/messenger/inc/hook_registration.inc.php'))
+                               {
+                                       include(PHPGW_SERVER_ROOT . 
'/messenger/inc/hook_registration.inc.php');
+                               }
                        }
                }
        }

Modified: trunk/registration/inc/class.uipending.inc.php
===================================================================
--- trunk/registration/inc/class.uipending.inc.php      2012-03-29 19:03:08 UTC 
(rev 9085)
+++ trunk/registration/inc/class.uipending.inc.php      2012-04-02 13:48:46 UTC 
(rev 9086)
@@ -84,7 +84,11 @@
                                $values['pending_users'] = 
isset($values['pending_users']) && $values['pending_users'] ? 
array_unique($values['pending_users']) : array();
                                $values['pending_users_orig'] = 
isset($values['pending_users_orig']) && $values['pending_users_orig'] ? 
array_unique($values['pending_users_orig']) : array();
                                
-                               $receipt = $this->bo->approve_users($values);
+                               $this->bo->approve_users($values);
+                               if(isset($values['process_user']) && 
$values['process_user'])
+                               {
+                                       $this->bo->process_users($values);
+                               }
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'registration.uipending.index'));
                        }
                        else
@@ -212,7 +216,7 @@
                                $values = 
$this->bocommon->collect_locationdata($values,$insert_record);
 
                                $values['id'] = $id;
-
+//_debug_array($values);die();
                                if($this->bo->update_pending_user($values))
                                {
                                        $message = lang('messages_saved_form');
@@ -260,14 +264,6 @@
                        $bolocation     = CreateObject('property.bolocation');
                        $user['location_data'] = 
isset($user['reg_info']['location_code']) && $user['reg_info']['location_code'] 
? $bolocation->read_single($user['reg_info']['location_code'],array('view' => 
true)) : '';
                                
-
-/*
-_debug_array($user);
-_debug_array($user_data);
-_debug_array($fields);
-die();
-*/
-
                        $location_data=$bolocation->initiate_ui_location(array(
                                'values'        => $user['location_data'],
                                'type_id'       => -1,
@@ -282,10 +278,9 @@
                        $data = array
                        (
                                'value_id'                              => $id,
-                               'img_go_home'                   => 
'rental/templates/base/images/32x32/actions/go-home.png',
-                               'editable'                              => true,
                                'user_data'                             => 
$user_data,
-                               'location_data'                 => 
$location_data
+                               'location_data'                 => 
$location_data,
+                               'value_approved'                => 
$user['reg_approved']
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('registration') . '::' . lang('edit user');

Modified: trunk/registration/inc/class.uireg.inc.php
===================================================================
--- trunk/registration/inc/class.uireg.inc.php  2012-03-29 19:03:08 UTC (rev 
9085)
+++ trunk/registration/inc/class.uireg.inc.php  2012-04-02 13:48:46 UTC (rev 
9086)
@@ -435,13 +435,16 @@
 
                function ready_to_activate()
                {
-//                     global $reg_id;
                        $reg_id = phpgw::get_var('reg_id');
 
                        if ($this->config['activate_account'] == 'email')
                        {
                                $this->simple_screen('confirm_email_sent.tpl');
                        }
+                       else if ($this->config['activate_account'] == 
'pending_approval')
+                       {
+                               
$this->simple_screen('confirm_pending_approval.tpl');
+                       }
                        else
                        {
                                /* ($this->config['activate_account'] == 
'immediately') */

Modified: trunk/registration/templates/base/config.tpl
===================================================================
--- trunk/registration/templates/base/config.tpl        2012-03-29 19:03:08 UTC 
(rev 9085)
+++ trunk/registration/templates/base/config.tpl        2012-04-02 13:48:46 UTC 
(rev 9086)
@@ -49,6 +49,7 @@
     <td>{lang_Activate_account}:</td>
     <td>
      <select name="newsettings[activate_account]">
+      <option 
value="pending_approval"{selected_activate_account_pending_approval}>{lang_pending_approval}</option>
       <option 
value="email"{selected_activate_account_email}>{lang_Send_Email}</option>
       <option 
value="immediately"{selected_activate_account_immediately}>{lang_Immediately}</option>
      </select>
@@ -92,7 +93,13 @@
    <td>{lang_Subject_for_confirmation_email}:</td>
    <td><input name="newsettings[subject_confirm]" 
value="{value_subject_confirm}"></td>
   </tr>
-  <tr bgcolor="{row_off}">
+       <tr class="row_off">
+               <td>{lang_messenger_welcome_message}</td>
+               <td>
+                       <textarea cols="40" rows="4" 
name="newsettings[messenger_welcome_message]" 
wrap="virtual">{value_messenger_welcome_message}</textarea>
+               </td>
+       </tr>
+  <tr bgcolor="{row_on}">
 
 <!-- END body -->
 

Added: trunk/registration/templates/base/confirm_pending_approval.tpl
===================================================================
--- trunk/registration/templates/base/confirm_pending_approval.tpl              
                (rev 0)
+++ trunk/registration/templates/base/confirm_pending_approval.tpl      
2012-04-02 13:48:46 UTC (rev 9086)
@@ -0,0 +1,5 @@
+<center>
+ <p>
+  Din påmelding er registert og du vil få en epost når den er behandlet og 
godkjent.
+ </p>
+</center>

Modified: trunk/registration/templates/base/pending_users.xsl
===================================================================
--- trunk/registration/templates/base/pending_users.xsl 2012-03-29 19:03:08 UTC 
(rev 9085)
+++ trunk/registration/templates/base/pending_users.xsl 2012-04-02 13:48:46 UTC 
(rev 9086)
@@ -88,11 +88,15 @@
        
        <xsl:call-template name="datasource-definition" />
        <xsl:variable name="label_submit"><xsl:value-of 
select="php:function('lang', 'save')" /></xsl:variable>
+       <xsl:variable name="label_process"><xsl:value-of 
select="php:function('lang', 'process')" /></xsl:variable>
        <xsl:variable name="label_checkAll"><xsl:value-of 
select="php:function('lang', 'invert_checkboxes')" /></xsl:variable>
        <div><input type="button" id="select_all" value="{$label_checkAll}" 
onclick="checkAll('mychecks')"/></div>
        
        <form action="#" name="user_form" id="user_form" method="post">
-               <div class="user_submit"><input type="submit" 
name="values[save_user]" id="save_user" value="{$label_submit}" onclick="return 
onSave()"/></div>
+               <div class="user_submit">
+                       <input type="submit" name="values[save_user]" 
id="save_user" value="{$label_submit}" onclick="return onSave()"/>
+                       <input type="submit" name="values[process_user]" 
id="process_user" value="{$label_process}" onclick="return onSave()"/>
+               </div>
        </form>
 </xsl:template>
 

Modified: trunk/registration/templates/base/user_edit.xsl
===================================================================
--- trunk/registration/templates/base/user_edit.xsl     2012-03-29 19:03:08 UTC 
(rev 9085)
+++ trunk/registration/templates/base/user_edit.xsl     2012-04-02 13:48:46 UTC 
(rev 9086)
@@ -26,20 +26,41 @@
                                                </tr>
                                        </xsl:for-each>
                                        <xsl:call-template 
name="location_form"/>                       
+                                       <tr>
+                                               <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'approve')" />
+                                               </td>
+                                               <td>
+                                                       <input type="checkbox" 
name="values[approve]" value="1">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'approve')"/>
+                                                               </xsl:attribute>
+                                                               <xsl:if 
test="value_approved = '1'">
+                                                                       
<xsl:attribute name="checked">
+                                                                               
<xsl:text>checked</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </xsl:if>
+                                                       </input>
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'process')" />
+                                               </td>
+                                               <td>
+                                                       <input type="checkbox" 
name="values[process]" value="1">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'process approved')"/>
+                                                               </xsl:attribute>
+                                                       </input>
+                                               </td>
+                                       </tr>
                                </table>
                                <div class="form-buttons">
-                                       <xsl:choose>
-                                               <xsl:when test="editable">
-                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
-                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="save" value="{$lang_save}" title = "{$lang_save}" />
-                                                       <input type="submit" 
name="cancel" value="{$lang_cancel}" title = "{$lang_cancel}" />
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="edit" value="{$lang_edit}" title = "{$lang_edit}" />
-                                               </xsl:otherwise>
-                                       </xsl:choose>
+                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
+                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
+                                       <input type="submit" name="save" 
value="{$lang_save}" title = "{$lang_save}" />
+                                       <input type="submit" name="cancel" 
value="{$lang_cancel}" title = "{$lang_cancel}" />
                                </div>
                        </form>                 
                </div>




reply via email to

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