fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11048] mobuilefrontend: custom auth


From: Sigurd Nes
Subject: [Fmsystem-commits] [11048] mobuilefrontend: custom auth
Date: Wed, 10 Apr 2013 10:22:37 +0000

Revision: 11048
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11048
Author:   sigurdne
Date:     2013-04-10 10:22:37 +0000 (Wed, 10 Apr 2013)
Log Message:
-----------
mobuilefrontend: custom auth

Modified Paths:
--------------
    trunk/mobilefrontend/inc/class.hook_helper.inc.php
    trunk/mobilefrontend/setup/setup.inc.php
    trunk/mobilefrontend/setup/tables_update.inc.php

Added Paths:
-----------
    trunk/mobilefrontend/inc/class.menu.inc.php
    trunk/mobilefrontend/templates/base/config.tpl

Modified: trunk/mobilefrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/mobilefrontend/inc/class.hook_helper.inc.php  2013-04-10 08:27:26 UTC 
(rev 11047)
+++ trunk/mobilefrontend/inc/class.hook_helper.inc.php  2013-04-10 10:22:37 UTC 
(rev 11048)
@@ -40,6 +40,15 @@
                public function set_auth_type()
                {
                        //get from local config
-                       $GLOBALS['phpgw_info']['server']['auth_type'] = 'sql';
+
+                       $config         = 
CreateObject('phpgwapi.config','mobilefrontend');
+                       $config->read();
+                       
+                       if(isset($config->config_data['auth_type']) && 
$config->config_data['auth_type'])
+                       {
+                               $GLOBALS['phpgw_info']['server']['auth_type'] = 
$config->config_data['auth_type'];
+                       }
+
+//_debug_array($GLOBALS['phpgw_info']['server']);die();
                }
        }

Added: trunk/mobilefrontend/inc/class.menu.inc.php
===================================================================
--- trunk/mobilefrontend/inc/class.menu.inc.php                         (rev 0)
+++ trunk/mobilefrontend/inc/class.menu.inc.php 2013-04-10 10:22:37 UTC (rev 
11048)
@@ -0,0 +1,27 @@
+<?php
+       class mobilefrontend_menu
+       {
+               function get_menu()
+               {
+                       $incoming_app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 
'mobilefrontend';
+
+                       $menus = array();
+
+                       if ( $GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin')
+                       || $GLOBALS['phpgw']->acl->check('admin', 
phpgwapi_acl::ADD, 'mobilefrontend'))
+                       {
+                               $menus['admin'] = array
+                               (
+                                       'index' => array
+                                       (
+                                               'text'  => 
lang('Configuration'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig.index', 'appname' => 'mobilefrontend') )
+                                       ),
+                               );
+                       }
+
+                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 
$incoming_app;
+                       return $menus;
+               }
+       }

Modified: trunk/mobilefrontend/setup/setup.inc.php
===================================================================
--- trunk/mobilefrontend/setup/setup.inc.php    2013-04-10 08:27:26 UTC (rev 
11047)
+++ trunk/mobilefrontend/setup/setup.inc.php    2013-04-10 10:22:37 UTC (rev 
11048)
@@ -52,7 +52,8 @@
        (
                'config',
                'home',
-               'set_auth_type' => 'mobilefrontend.hook_helper.set_auth_type'
+               'set_auth_type' => 'mobilefrontend.hook_helper.set_auth_type',
+               'menu'                  => 'mobilefrontend.menu.get_menu'
        );
 
        /* Dependencies for this app to work */

Modified: trunk/mobilefrontend/setup/tables_update.inc.php
===================================================================
--- trunk/mobilefrontend/setup/tables_update.inc.php    2013-04-10 08:27:26 UTC 
(rev 11047)
+++ trunk/mobilefrontend/setup/tables_update.inc.php    2013-04-10 10:22:37 UTC 
(rev 11048)
@@ -14,16 +14,11 @@
        /**
        * Update mobilefrontend version from '0.1.1' to '0.1.2';
        */
-/*
+
        $test[] = '0.1.1';
        function mobilefrontend_upgrade0_1_1()
        {
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
-
-               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
-               {
-                       $GLOBALS['setup_info']['mobilefrontend']['currentver'] 
= '0.1.2';
-                       return 
$GLOBALS['setup_info']['mobilefrontend']['currentver'];
-               }
+               $GLOBALS['setup_info']['mobilefrontend']['currentver'] = 
'0.1.2';
+               return $GLOBALS['setup_info']['mobilefrontend']['currentver'];
        }
-*/
+

Added: trunk/mobilefrontend/templates/base/config.tpl
===================================================================
--- trunk/mobilefrontend/templates/base/config.tpl                              
(rev 0)
+++ trunk/mobilefrontend/templates/base/config.tpl      2013-04-10 10:22:37 UTC 
(rev 11048)
@@ -0,0 +1,40 @@
+<!-- BEGIN header -->
+<form method="POST" action="{action_url}">
+       <table border="0" align="center" width="85%">
+               <tr class="th">
+                       <td colspan="2"><font 
color="{th_text}">&nbsp;<b>{title}</b></font></td>
+               </tr>
+               <!-- END header -->
+               <!-- BEGIN body -->
+               <tr class="row_on">
+                       <td colspan="2">&nbsp;</td>
+               </tr>
+               <tr class="row_off">
+                       <td colspan="2">&nbsp;<b>{lang_mobilefrontend}</b></td>
+               </tr>
+               <tr class="row_on">
+                       <td>{lang_auth_type}:</td>
+                       <td>
+                               <select name="newsettings[auth_type]">
+                                       <option value="0" 
{selected_auth_type_0}>Same as framework</option>
+                                       <option value="sql" 
{selected_auth_type_sql}>SQL</option>
+                                       <option value="custom" 
{selected_auth_type_custom}>Custom</option>
+                               </select>
+                       </td>
+               </tr>
+               <!-- END body -->
+               <!-- BEGIN footer -->
+               <tr class="th">
+                       <td colspan="2">
+                               &nbsp;
+                       </td>
+               </tr>
+               <tr>
+                       <td colspan="2" align="center">
+                               <input type="submit" name="submit" 
value="{lang_submit}">
+                               <input type="submit" name="cancel" 
value="{lang_cancel}">
+                       </td>
+               </tr>
+       </table>
+</form>
+<!-- END footer -->




reply via email to

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