fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16493] preparing for php7.1


From: sigurdne
Subject: [Fmsystem-commits] [16493] preparing for php7.1
Date: Wed, 29 Mar 2017 09:43:58 -0400 (EDT)

Revision: 16493
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16493
Author:   sigurdne
Date:     2017-03-29 09:43:57 -0400 (Wed, 29 Mar 2017)
Log Message:
-----------
preparing for php7.1

Modified Paths:
--------------
    trunk/eventplanner/inc/class.sogeneric.inc.php
    trunk/header.inc.php.template
    trunk/helpdesk/inc/class.sogeneric.inc.php
    trunk/phpgwapi/inc/class.socommon.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.sogeneric_.inc.php
    trunk/rental/inc/class.sogeneric.inc.php
    trunk/rental/setup/tables_current.inc.php
    trunk/setup/manageheader.php
    trunk/setup/templates/base/manageheader.tpl

Modified: trunk/eventplanner/inc/class.sogeneric.inc.php
===================================================================
--- trunk/eventplanner/inc/class.sogeneric.inc.php      2017-03-29 13:26:42 UTC 
(rev 16492)
+++ trunk/eventplanner/inc/class.sogeneric.inc.php      2017-03-29 13:43:57 UTC 
(rev 16493)
@@ -35,7 +35,7 @@
                        parent::__construct($type, $type_id);
                }
 
-               public function get_location_info( $type, $type_id )
+               public function get_location_info( $type, $type_id = 0 )
                {
 
                        $type_id = (int)$type_id;

Modified: trunk/header.inc.php.template
===================================================================
--- trunk/header.inc.php.template       2017-03-29 13:26:42 UTC (rev 16492)
+++ trunk/header.inc.php.template       2017-03-29 13:43:57 UTC (rev 16493)
@@ -149,6 +149,13 @@
        $GLOBALS['phpgw_info']['server']['lost_password_url'] = 
'{LOST_PASSWORD_URL}';
 
        /**
+       * @global string $phpgw_info['server']['enable_crypto']
+       * phpGroupWare offers 2 session management systems - php and db
+       * Unless you really know what you are doing use php here as it works 
better 99.5% of the time
+       */
+       $GLOBALS['phpgw_info']['server']['enable_crypto'] = '{ENABLE_CRYPTO}';
+
+       /**
        * @global boolean $phpgw_info['server']['mcrypt_enabled']
        * This is used to control mcrypt's use
        */
@@ -171,6 +178,13 @@
        */
        $GLOBALS['phpgw_info']['server']['setup_mcrypt_key'] = 
'{SETUP_MCRYPT_KEY}';
 
+       /**
+       * @global string $phpgw_info['server']['setup_libsodium_key']
+       * This is a random string used as the encryption key for libsodium
+       * Never change it!
+       */
+       $GLOBALS['phpgw_info']['server']['setup_libsodium_key'] = 
'{SETUP_LIBSODIUM_KEY}';
+
        /*
                This ensures IE gets the right character set
        */

Modified: trunk/helpdesk/inc/class.sogeneric.inc.php
===================================================================
--- trunk/helpdesk/inc/class.sogeneric.inc.php  2017-03-29 13:26:42 UTC (rev 
16492)
+++ trunk/helpdesk/inc/class.sogeneric.inc.php  2017-03-29 13:43:57 UTC (rev 
16493)
@@ -38,7 +38,7 @@
                }
 
 
-               public function get_location_info( $type, $type_id )
+               public function get_location_info( $type, $type_id = 0 )
                {
 
                        $type_id = (int)$type_id;

Modified: trunk/phpgwapi/inc/class.socommon.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.socommon.inc.php   2017-03-29 13:26:42 UTC (rev 
16492)
+++ trunk/phpgwapi/inc/class.socommon.inc.php   2017-03-29 13:43:57 UTC (rev 
16493)
@@ -271,6 +271,7 @@
                                }
                                $results[] = $row;
                        }
+                       $id_map = array();
                        if (count($results) > 0)
                        {
                                foreach ($results as $id => $result)
@@ -302,6 +303,7 @@
                                                        while 
($this->db->next_record())
                                                        {
                                                                $id = 
$this->unmarshal($this->db->f($key, false), 'int');
+                                                               
$results[$id_map[$id]][$field] = array();
                                                                $data = array();
                                                                foreach 
($params['manytomany']['column'] as $intOrCol => $paramsOrCol)
                                                                {

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2017-03-29 13:26:42 UTC (rev 
16492)
+++ trunk/property/inc/class.sogeneric.inc.php  2017-03-29 13:43:57 UTC (rev 
16493)
@@ -44,7 +44,7 @@
                }
 
 
-               public function get_location_info( $type, $type_id )
+               public function get_location_info( $type, $type_id = 0 )
                {
                        $type_id = (int)$type_id;
                        $this->type = $type;

Modified: trunk/property/inc/class.sogeneric_.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric_.inc.php 2017-03-29 13:26:42 UTC (rev 
16492)
+++ trunk/property/inc/class.sogeneric_.inc.php 2017-03-29 13:43:57 UTC (rev 
16493)
@@ -340,7 +340,7 @@
                        return $values;
                }
 
-               abstract function get_location_info( $type, $type_id );
+               abstract function get_location_info( $type, $type_id = 0 );
 
                public function get_name( $data )
                {

Modified: trunk/rental/inc/class.sogeneric.inc.php
===================================================================
--- trunk/rental/inc/class.sogeneric.inc.php    2017-03-29 13:26:42 UTC (rev 
16492)
+++ trunk/rental/inc/class.sogeneric.inc.php    2017-03-29 13:43:57 UTC (rev 
16493)
@@ -35,7 +35,7 @@
                        parent::__construct($type, $type_id);
                }
 
-               public function get_location_info( $type, $type_id )
+               public function get_location_info( $type, $type_id = 0 )
                {
 
                        $type_id = (int)$type_id;

Modified: trunk/rental/setup/tables_current.inc.php
===================================================================
--- trunk/rental/setup/tables_current.inc.php   2017-03-29 13:26:42 UTC (rev 
16492)
+++ trunk/rental/setup/tables_current.inc.php   2017-03-29 13:43:57 UTC (rev 
16493)
@@ -240,8 +240,18 @@
                                'location_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => true),
                                'result_unit_number' => array('type' => 
'varchar', 'precision' => '255', 'nullable' => true),
                                'org_enhet_id' => array('type' => 'int', 
'precision' => 8, 'nullable' => true),
-                               'unit_leader' => array('type' => 'varchar', 
'precision' => '255', 'nullable' => true)
+                               'unit_leader' => array('type' => 'varchar', 
'precision' => '255', 'nullable' => true),
+//                             'organization_number' => array('type' => 
'varchar', 'precision' => '9','nullable' => True),
                        ),
+/**
+ *
+1.       Kundenr.
+2.       Org.nr.
+3.       Ansattnr.
+4.       Født nr. (dd.mm.åååå)
+5.       Koststed (fire siffer)
+
+ */
                        'pk' => array('id'),
                        'fk' => array(),
                        'ix' => array(),

Modified: trunk/setup/manageheader.php
===================================================================
--- trunk/setup/manageheader.php        2017-03-29 13:26:42 UTC (rev 16492)
+++ trunk/setup/manageheader.php        2017-03-29 13:43:57 UTC (rev 16493)
@@ -22,7 +22,7 @@
         * Include setup functions
         */
        require_once('./inc/functions.inc.php');
-       
+
        srand((double)microtime()*1000000);
        $random_char = array(
                '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',
@@ -49,6 +49,15 @@
                }
        }
 
+
+       if(extension_loaded('libsodium'))
+       {
+               
if(empty($GLOBALS['phpgw_info']['server']['setup_libsodium_key']))
+               {
+                       $GLOBALS['phpgw_info']['server']['setup_libsodium_key'] 
= base64_encode(\Sodium\randombytes_buf(\Sodium\CRYPTO_SECRETBOX_KEYBYTES));
+               }
+       }
+
        //$GLOBALS['phpgw_info']['server']['versions']['current_header'] = 
$setup_info['phpgwapi']['versions']['current_header'];
        unset($setup_info);
 
@@ -246,10 +255,10 @@
                        }
 */
 
-                       if (version_compare(PHP_VERSION, '5.2.0') < 0)
+                       if (version_compare(PHP_VERSION, '5.3.0') < 0)
                        {
                                $detected .= '<b><p align="center" class="msg">'
-                                       . lang('You appear to be using PHP %1, 
phpGroupWare requires version 5.2.0 or later', PHP_VERSION). "\n"
+                                       . lang('You appear to be using PHP %1, 
phpGroupWare requires version 5.3.0 or later', PHP_VERSION). "\n"
                                        . 
'</p></b><td></tr></table></body></html>';
                                die($detected);
                        }
@@ -269,13 +278,13 @@
                                {
                                        $request_order = '<li>' . lang('You 
appear to have set request_order = "GPCS"') . "</li>\n";
                                }
-                               
+
                        }
 
                        if ( !function_exists('json_encode') ) // Some 
distributions have removed the standard JSON extension as of PHP 5.5rc2 due to 
a license conflict
                        {
                                $detected .= '<b><p align="center" class="msg">'
-                                       . "You have to install php5-json\n"
+                                       . "You have to install php-json\n"
                                        . 
'</p></b><td></tr></table></body></html>';
                                die($detected);
                        }
@@ -293,7 +302,7 @@
                                }
                        }
 
-                       $phpver = '<li>' . lang('You appear to be using PHP 
%1+', 5.2) . "</li>\n";
+                       $phpver = '<li>' . lang('You appear to be using PHP 
%1+', 5.3) . "</li>\n";
                        $supported_sessions_type = array('php', 'db');
 
                        $detected .= '<table id="manageheader">' . "\n";
@@ -358,6 +367,11 @@
                                }
                        }
 
+                       if(!class_exists('ZipArchive'))
+                       {
+                               $detected .= '<li class="warn">' . lang('you 
need ZipArchive for Excel-support') . "</li>\n";
+                       }
+
                        /* Not currently supported
                        if (extension_loaded('odbc') || 
function_exists('odbc_connect'))
                        {
@@ -429,15 +443,29 @@
                        {
                                $detected .= '<li class="warn">' . lang('No 
support for shared memory found.') . "</li>\n";
                        }
+
+                       $supported_crypto_type = array();
+                       if(extension_loaded('libsodium') || 
function_exists('\Sodium\version_string()'))
+                       {
+                               $supported_crypto_type[] = 'libsodium';
+                               $detected .= '<li>' . lang('You appear to have 
enabled support for libsodium %1', \Sodium\version_string()) . "</li>\n";
+                       }
+                       else
+                       {
+                               $detected .= '<li class="warn">' . lang('No 
libsodium support found.') . "</li>\n";
+                       }
+
                        if(extension_loaded('mcrypt') || 
function_exists('mcrypt_list_modes'))
                        {
+                               $supported_crypto_type[] = 'mcrypt';
                                $detected .= '<li>' . lang('You appear to have 
enabled support for mcrypt') . "</li>\n";
-//                             
$GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = true;
                        }
                        else
                        {
                                $detected .= '<li class="warn">' . lang('No 
mcrypt support found.') . "</li>\n";
-                       }               
+                       }
+
+
                        if( extension_loaded('xsl') && 
class_exists('XSLTProcessor') )
                        {
                                $detected .= '<li>' . lang('You appear to have 
XML/XSLT support enabled') . "</li>\n";
@@ -680,6 +708,28 @@
                        }
                        $setup_tpl->set_var('session_options',$session_options);
 
+                       unset($stype);
+                       $selected = '';
+                       $crypto_options = '';
+                       $crypto_options .= <<<HTML
+                               <option value="">None</option>
+
+HTML;
+                       foreach ( $supported_crypto_type as $stype )
+                       {
+                               $selected = '';
+                               if( 
isset($GLOBALS['phpgw_info']['server']['enable_crypto'])
+                                       && $stype == 
$GLOBALS['phpgw_info']['server']['enable_crypto'])
+                               {
+                                       $selected = ' selected ';
+                               }
+                               $crypto_options .= <<<HTML
+                                       <option{$selected} 
value="{$stype}">{$stype}</option>
+
+HTML;
+                       }
+                       $setup_tpl->set_var('crypto_options',$crypto_options);
+
                        if ( 
isset($GLOBALS['phpgw_info']['server']['mcrypt_enabled']) && 
$GLOBALS['phpgw_info']['server']['mcrypt_enabled'] )
                        {
                                $setup_tpl->set_var('mcrypt_enabled_yes',' 
selected');
@@ -693,6 +743,8 @@
 
                        
$setup_tpl->set_var('setup_mcrypt_key',$GLOBALS['phpgw_info']['server']['setup_mcrypt_key']);
 
+                       
$setup_tpl->set_var('setup_libsodium_key',$GLOBALS['phpgw_info']['server']['setup_libsodium_key']);
+
                        if ( 
!isset($GLOBALS['phpgw_info']['server']['setup_acl']) || 
!$GLOBALS['phpgw_info']['server']['setup_acl'] )
                        {
                                $GLOBALS['phpgw_info']['server']['setup_acl'] = 
'127.0.0.1';
@@ -773,6 +825,7 @@
                        $setup_tpl->set_var('lang_persistdescr',lang('Do you 
want persistent connections (higher performance, but consumes more 
resources)'));
                        $setup_tpl->set_var('lang_sesstype',lang('Sessions 
Type'));
                        $setup_tpl->set_var('lang_sesstypedescr',lang('What 
type of sessions management do you want to use (PHP session management usually 
performs better)?'));
+                       $setup_tpl->set_var('lang_enable_crypto',lang('Enable 
Crypto'));
                        $setup_tpl->set_var('lang_enablemcrypt',lang('Enable 
MCrypt'));
                        $setup_tpl->set_var('lang_mcryptversion',lang('MCrypt 
version'));
                        $setup_tpl->set_var('lang_mcryptversiondescr',lang('Set 
this to "old" for versions &lt; 2.4, otherwise the exact mcrypt version you 
use.'));
@@ -782,6 +835,8 @@
                        $setup_tpl->set_var('lang_setup_mcrypt_key',lang('Enter 
some random text as encryption key for the setup encryption'));
                        
$setup_tpl->set_var('lang_setup_mcrypt_key_descr',lang('This should be around 
30 bytes in length.<br>Note: The default has been randomly generated.'));
 
+                       
$setup_tpl->set_var('lang_setup_libsodium_key',lang('Libsodium key'));
+
                        $setup_tpl->set_var('lang_domselect',lang('Domain 
select box on login'));
                        $setup_tpl->set_var('lang_domain_from_host', 
lang('Automatically detect domain from hostname'));
                        $setup_tpl->set_var('lang_note_domain_from_host', 
lang('Note: This option will only work if show domain select box is off.'));

Modified: trunk/setup/templates/base/manageheader.tpl
===================================================================
--- trunk/setup/templates/base/manageheader.tpl 2017-03-29 13:26:42 UTC (rev 
16492)
+++ trunk/setup/templates/base/manageheader.tpl 2017-03-29 13:43:57 UTC (rev 
16493)
@@ -60,6 +60,13 @@
     <td>{lang_sesstypedescr}</td>
   </tr>
   <tr>
+    <td colspan=2><b>{lang_enable_crypto}</b><br>
+      <select name="setting[enable_crypto]">
+{crypto_options}
+      </select>
+    </td>
+  </tr>
+  <tr>
     <td colspan=2><b>{lang_enablemcrypt}</b><br>
       <select name="setting[enable_mcrypt]">
         <option value="True"{mcrypt_enabled_yes}>True
@@ -76,6 +83,11 @@
     <td>{lang_setup_mcrypt_key_descr}</td>
   </tr>
   <tr>
+         <td><b>{lang_setup_libsodium_key}</b><br><input type="text" 
name="setting[setup_libsodium_key]" value="{setup_libsodium_key}" size="40" 
readonly="readonly" ></td>
+    <td>{lang_setup_libsodium_key_descr}</td>
+  </tr>
+
+  <tr>
     <td><b>{lang_domselect}</b><br>
       <select name="setting[domain_selectbox]">
         <option value="True"{domain_selectbox_yes}>True</option>




reply via email to

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