[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16495] preparing for php7.1
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16495] preparing for php7.1 |
Date: |
Thu, 30 Mar 2017 05:32:02 -0400 (EDT) |
Revision: 16495
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16495
Author: sigurdne
Date: 2017-03-30 05:32:01 -0400 (Thu, 30 Mar 2017)
Log Message:
-----------
preparing for php7.1
Modified Paths:
--------------
trunk/header.inc.php.template
trunk/phpgwapi/inc/class.crypto.inc.php
trunk/phpgwapi/inc/class.crypto_libsodium.inc.php
trunk/phpgwapi/inc/class.crypto_mcrypt.inc.php
trunk/phpgwapi/inc/class.setup.inc.php
trunk/setup/inc/functions.inc.php
trunk/setup/lang/phpgw_de.lang
trunk/setup/lang/phpgw_en.lang
trunk/setup/lang/phpgw_fr.lang
trunk/setup/lang/phpgw_no.lang
trunk/setup/lang/phpgw_tr.lang
trunk/setup/manageheader.php
trunk/setup/templates/base/manageheader.tpl
Modified: trunk/header.inc.php.template
===================================================================
--- trunk/header.inc.php.template 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/header.inc.php.template 2017-03-30 09:32:01 UTC (rev 16495)
@@ -158,8 +158,9 @@
/**
* @global boolean $phpgw_info['server']['mcrypt_enabled']
* This is used to control mcrypt's use
+ * Note: deprecated
*/
- $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = {ENABLE_MCRYPT};
+ $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = false;
/**
* @global string $phpgw_info['server']['mcrypt_iv']
Modified: trunk/phpgwapi/inc/class.crypto.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.crypto.inc.php 2017-03-30 07:36:55 UTC (rev
16494)
+++ trunk/phpgwapi/inc/class.crypto.inc.php 2017-03-30 09:32:01 UTC (rev
16495)
@@ -20,7 +20,7 @@
}
else
{
- //Dummy
+ //Fall back
class phpgwapi_crypto extends phpgwapi_crypto_
{
}
Modified: trunk/phpgwapi/inc/class.crypto_libsodium.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.crypto_libsodium.inc.php 2017-03-30 07:36:55 UTC
(rev 16494)
+++ trunk/phpgwapi/inc/class.crypto_libsodium.inc.php 2017-03-30 09:32:01 UTC
(rev 16495)
@@ -26,20 +26,14 @@
function init( $vars )
{
- // $key = base64_decode($vars[0]);
$key = $vars[0];
- $iv = $vars[1];
- // _debug_array(\Sodium\CRYPTO_SECRETBOX_KEYBYTES);
- //
_debug_array(mb_strlen(base64_decode('mUVoE1U1atXQ91RgjDV0a4S2fzevs6K4GlgAEIOnu1g='),'8bit'));
die();
-
if ($GLOBALS['phpgw_info']['server']['enable_crypto']
== 'libsodium' && extension_loaded('libsodium') && !$this->enabled)
{
- //For now...
- $this->enabled = false;
+ $this->enabled = true;
$keysize = \Sodium\CRYPTO_SECRETBOX_KEYBYTES;
- //_debug_array($keysize);
+
/* Hack Key to be the correct size */
$x = strlen($key);
@@ -54,7 +48,7 @@
{
if ($this->enabled)
{
-// @mcrypt_generic_deinit($this->td);
+ \Sodium\memzero($this->key);
}
}
@@ -234,11 +228,12 @@
$decoded = base64_decode($encrypted);
if ($decoded === false)
{
- throw new \Exception('Scream bloody murder, the
encoding failed');
+ return false;
+// throw new \Exception('Scream bloody murder, the
encoding failed');
}
if (mb_strlen($decoded, '8bit') <
(\Sodium\CRYPTO_SECRETBOX_NONCEBYTES + \Sodium\CRYPTO_SECRETBOX_MACBYTES))
{
- throw new \Exception('Scream bloody murder, the
message was truncated');
+// throw new \Exception('Scream bloody murder, the
message was truncated');
}
$nonce = mb_substr($decoded, 0,
\Sodium\CRYPTO_SECRETBOX_NONCEBYTES, '8bit');
$ciphertext = mb_substr($decoded,
\Sodium\CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit');
@@ -248,7 +243,7 @@
);
if ($plain === false)
{
- throw new \Exception('Scream bloody murder, the
message was tampered with in transit');
+// throw new \Exception('Scream bloody murder, the
message was tampered with in transit');
}
\Sodium\memzero($ciphertext);
\Sodium\memzero($key);
Modified: trunk/phpgwapi/inc/class.crypto_mcrypt.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.crypto_mcrypt.inc.php 2017-03-30 07:36:55 UTC
(rev 16494)
+++ trunk/phpgwapi/inc/class.crypto_mcrypt.inc.php 2017-03-30 09:32:01 UTC
(rev 16495)
@@ -30,7 +30,7 @@
$key = $vars[0];
$iv = $vars[1];
- if ($GLOBALS['phpgw_info']['server']['mcrypt_enabled']
&& extension_loaded('mcrypt') && !$this->enabled)
+ if (($GLOBALS['phpgw_info']['server']['mcrypt_enabled']
|| $GLOBALS['phpgw_info']['server']['enable_crypto'] == 'mcrypt') &&
extension_loaded('mcrypt') && !$this->enabled)
{
$this->algo = MCRYPT_TRIPLEDES;
$this->mode = MCRYPT_MODE_CBC;
Modified: trunk/phpgwapi/inc/class.setup.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup.inc.php 2017-03-30 07:36:55 UTC (rev
16494)
+++ trunk/phpgwapi/inc/class.setup.inc.php 2017-03-30 09:32:01 UTC (rev
16495)
@@ -206,7 +206,8 @@
setcookie('ConfigLang', $ConfigLang,
$expire);
return True;
}
- else if($HeaderPW ==
md5(stripslashes($GLOBALS['phpgw_info']['server']['header_admin_password'])))
+ else
+ if($HeaderPW ==
md5(stripslashes($GLOBALS['phpgw_info']['server']['header_admin_password'])))
{
setcookie('HeaderPW', $HeaderPW ,
$expire);
setcookie('ConfigLang', $ConfigLang,
$expire);
Modified: trunk/setup/inc/functions.inc.php
===================================================================
--- trunk/setup/inc/functions.inc.php 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/setup/inc/functions.inc.php 2017-03-30 09:32:01 UTC (rev 16495)
@@ -346,9 +346,11 @@
$GLOBALS['phpgw_info']['server']['app_images'] =
'templates/base/images';
- if(isset($_POST['setting']['enable_mcrypt']) &&
$_POST['setting']['enable_mcrypt'] == 'True')
+// if(isset($_POST['setting']['enable_mcrypt']) &&
$_POST['setting']['enable_mcrypt'] == 'True')
+ if(!empty($_POST['setting']['enable_crypto']))
{
- $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = true;
+// $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = true;
+ $GLOBALS['phpgw_info']['server']['enable_crypto'] =
$_POST['setting']['enable_crypto'];
$_iv = $_POST['setting']['mcrypt_iv'];
$_key = $_POST['setting']['setup_mcrypt_key'];
}
Modified: trunk/setup/lang/phpgw_de.lang
===================================================================
--- trunk/setup/lang/phpgw_de.lang 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/setup/lang/phpgw_de.lang 2017-03-30 09:32:01 UTC (rev 16495)
@@ -306,7 +306,7 @@
this section will help you export users and groups from phpgroupware's account
tables into your ldap tree setup de Dieser Abschnitt wird Ihnen
beim exportieren von Benutzern/Gruppen aus phpGroupWare's Account Tabellen in
Ihren LDAP Baum behilflich sein
this section will help you import users and groups from your ldap tree into
phpgroupware's account tables setup de Dieser Abschnitt wird Ihnen
beim importieren von Benutzern/Gruppen aus Ihrem LDAP Baum in phpGroupWare's
Account Tabellen behilflich sein
this section will help you setup your ldap accounts for use with phpgroupware
setup de Dieser Abschnitt wird ihnen helfen ihrer LDAP Benutzer für
phpGroupWare vorzubereiten.
-this should be around 30 bytes in length.<br>note: the default has been
randomly generated. setup de Das sollte ungefähr 30 Zeichen lang
sein<br>Hinweis: Die Vorgabe wurde zufällig erzeugt.
+this should be around 32 bytes in length.<br>note: the default has been
randomly generated. setup de Das sollte ungefähr 32 Zeichen lang
sein<br>Hinweis: Die Vorgabe wurde zufällig erzeugt.
this stage is completed<br> setup de Dieser Schritt ist
abgeschlossen<br>
this will create 1 admin account and 3 demo accounts<br>the username/passwords
are: demo/guest, demo2/guest and demo3/guest.<br><b>!!!this will delete all
existing accounts!!!</b><br> setup de Dies wird 1 Admin- und 3
Demo Benutzerkonten erstellen<br>Die Benutzernamen/Passworte sind: demo/guest,
demo2/guest and demo3/guest.<br><b>!!!DIES WIRD ALLE EXISTIERENDEN
BENUTZERKONTEN LÖSCHEN!!!</b><br>
to a version it does not know about setup de auf eine Version von
der nichts bekannt ist
Modified: trunk/setup/lang/phpgw_en.lang
===================================================================
--- trunk/setup/lang/phpgw_en.lang 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/setup/lang/phpgw_en.lang 2017-03-30 09:32:01 UTC (rev 16495)
@@ -326,7 +326,7 @@
this section will help you export users and groups from phpgroupware's account
tables into your ldap tree setup en This section will help you
export users and groups from phpGroupWare's account tables into your LDAP tree
this section will help you import users and groups from your ldap tree into
phpgroupware's account tables setup en This section will help you
import users and groups from your LDAP tree into phpGroupWare's account tables
this section will help you setup your ldap accounts for use with phpgroupware
setup en This section will help you setup your LDAP accounts for use
with phpGroupWare
-this should be around 30 bytes in length.<br>note: the default has been
randomly generated. setup en This should be around 30 bytes in
length.<br>Note: The default has been randomly generated.
+this should be around 32 bytes in length.<br>note: the default has been
randomly generated. setup en This should be around 32 bytes in
length.<br>Note: The default has been randomly generated.
this stage is completed<br> setup en This stage is completed<br>
this will create 1 admin account and 3 demo accounts<br>the username/passwords
are: demo/guest, demo2/guest and demo3/guest.<br><b>!!!this will delete all
existing accounts!!!</b><br> setup en This will create 1 admin
account and 3 demo accounts<br>The username/passwords are: demo/guest,
demo2/guest and demo3/guest.<br><b>!!!THIS WILL DELETE ALL EXISTING
ACCOUNTS!!!</b><br>
this will create an admin account and (optionally) 3 demo accounts.<br>the
username/passwords are: demo/guest, demo2/guest and demo3/guest.<br>
setup en This will create an admin account and (optionally) 3 demo
accounts.<br>The username/passwords are: demo/guest, demo2/guest and
demo3/guest.<br>
Modified: trunk/setup/lang/phpgw_fr.lang
===================================================================
--- trunk/setup/lang/phpgw_fr.lang 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/setup/lang/phpgw_fr.lang 2017-03-30 09:32:01 UTC (rev 16495)
@@ -322,7 +322,7 @@
this section will help you export users and groups from phpgroupWare's account
tables into your ldap tree setup fr Cette section va vous aider à
exporter les utilisateurs et groupes des tables de comptes de phpGroupWare vers
votre arbre LDAP
this section will help you import users and groups from your ldap tree into
phpGroupWare's account tables setup fr Cette section va vous aider
à importer les utilisateurs et groupes de votre arbre LDAP vers les tables de
comptes de phpGroupWare
this section will help you setup your LDAP accounts for use with phpGroupWare
setup fr Cette section va vous aider à configurer vos comptes LDAP pour
les utiliser dans phpGroupWare
-this should be around 30 bytes in length.<br>note: the default has been
randomly generated. setup fr Ceci devrait faire environ 30 octets de
long.<br>Note: la valeur par défaut a été générée au hasard.
+this should be around 32 bytes in length.<br>note: the default has been
randomly generated. setup fr Ceci devrait faire environ 32 octets de
long.<br>Note: la valeur par défaut a été générée au hasard.
this stage is completed<br> setup fr Cette étape est complétée<br>
this will create 1 admin account and 3 demo accounts<br>the username/passwords
are: demo/guest, demo2/guest and demo3/guest.<br><b>!!!THIS WILL DELETE ALL
EXISTING ACCOUNTS!!!</b><br> setup fr Ceci va créer 1 compte
admin et 3 comptes demo<br>Les utilisateurs/mots de passe sont: demo/guest,
demo2/guest et demo3/guest.<br><b>!!!CECI VA SUPPRIMER TOUS LES COMPTES
EXISTANTS!!!</b><br>
this will create an admin account and (optionally) 3 demo accounts.<br>the
username/passwords are: demo/guest, demo2/guest and demo3/guest.<br>
setup fr Ceci va créer un compte admin et 3 comptes demo
(optionnel).<br>Les utilisateurs/mots de passe sont: demo/guest, demo2/guest et
demo3/guest.<br>
Modified: trunk/setup/lang/phpgw_no.lang
===================================================================
--- trunk/setup/lang/phpgw_no.lang 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/setup/lang/phpgw_no.lang 2017-03-30 09:32:01 UTC (rev 16495)
@@ -326,7 +326,7 @@
this section will help you export users and groups from phpgroupware's account
tables into your ldap tree setup no This section will help you
export users and groups from phpGroupWare's account tables into your LDAP tree
this section will help you import users and groups from your ldap tree into
phpgroupware's account tables setup no This section will help you
import users and groups from your LDAP tree into phpGroupWare's account tables
this section will help you setup your ldap accounts for use with phpgroupware
setup no This section will help you setup your LDAP accounts for use
with phpGroupWare
-this should be around 30 bytes in length.<br>note: the default has been
randomly generated. setup no This should be around 30 bytes in
length.<br>Note: The default has been randomly generated.
+this should be around 32 bytes in length.<br>note: the default has been
randomly generated. setup no This should be around 32 bytes in
length.<br>Note: The default has been randomly generated.
this stage is completed<br> setup no This stage is completed<br>
this will create 1 admin account and 3 demo accounts<br>the username/passwords
are: demo/guest, demo2/guest and demo3/guest.<br><b>!!!this will delete all
existing accounts!!!</b><br> setup no This will create 1 admin
account and 3 demo accounts<br>The username/passwords are: demo/guest,
demo2/guest and demo3/guest.<br><b>!!!THIS WILL DELETE ALL EXISTING
ACCOUNTS!!!</b><br>
this will create an admin account and (optionally) 3 demo accounts.<br>the
username/passwords are: demo/guest, demo2/guest and demo3/guest.<br>
setup no This will create an admin account and (optionally) 3 demo
accounts.<br>The username/passwords are: demo/guest, demo2/guest and
demo3/guest.<br>
Modified: trunk/setup/lang/phpgw_tr.lang
===================================================================
--- trunk/setup/lang/phpgw_tr.lang 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/setup/lang/phpgw_tr.lang 2017-03-30 09:32:01 UTC (rev 16495)
@@ -302,7 +302,7 @@
this section will help you export users and groups from phpgroupware's account
tables into your ldap tree setup tr Bu bölüm size kullanıcı ve
grupları phpGroupWare hesap tablosundan LDAP ağaç yapısına taşımanıza yardım
eder
this section will help you import users and groups from your ldap tree into
phpgroupware's account tables setup tr Bu bölüm size kullanıcı ve
grupları phpGroupWare LDAP ağaç yapısından LDAP hesap tablosuna taşımanıza
yardım eder
this section will help you setup your ldap accounts for use with phpgroupware
setup tr Bu bölüm size LDAP hesaplarının phpgroupware ile
kullanılmasının düzenlenmesinde yardımcı olur
-this should be around 30 bytes in length.<br>note: the default has been
randomly generated. setup tr Bu yaklaşık 30 byte uzunluğunda
olabilir.<br>Dikkat: Varsayılan rastgele oluşturuldu.
+this should be around 32 bytes in length.<br>note: the default has been
randomly generated. setup tr Bu yaklaşık 32 byte uzunluğunda
olabilir.<br>Dikkat: Varsayılan rastgele oluşturuldu.
this stage is completed<br> setup tr Bu bölüm tamamlandı<br>
this will create 1 admin account and 3 demo accounts<br>the username/passwords
are: demo/guest, demo2/guest and demo3/guest.<br><b>!!!this will delete all
existing accounts!!!</b><br> setup tr Bu bir yönetici 3 te demo
hesap oluşturacaktır.<br>kullanıcı adı/şifreler: demo/guest, demo2/guest and
demo3/guest.<br><b>!!!BU VAROLAN BÜTÜN HESAPLARI SİLECEKTİR!!!</b><br>
to a version it does not know about setup tr bu versiyon tanınmıyor
Modified: trunk/setup/manageheader.php
===================================================================
--- trunk/setup/manageheader.php 2017-03-30 07:36:55 UTC (rev 16494)
+++ trunk/setup/manageheader.php 2017-03-30 09:32:01 UTC (rev 16495)
@@ -43,21 +43,12 @@
if(!isset($GLOBALS['phpgw_info']['server']['setup_mcrypt_key']) ||
!$GLOBALS['phpgw_info']['server']['setup_mcrypt_key'])
{
$GLOBALS['phpgw_info']['server']['setup_mcrypt_key'] = '';
- for($i=0; $i < 30; ++$i)
+ for($i=0; $i < 32; ++$i)
{
$GLOBALS['phpgw_info']['server']['setup_mcrypt_key'] .=
$random_char[rand(0,count($random_char)-1)];
}
}
-
- 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);
@@ -752,8 +743,6 @@
$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';
@@ -839,13 +828,11 @@
$setup_tpl->set_var('lang_mcryptversion',lang('MCrypt
version'));
$setup_tpl->set_var('lang_mcryptversiondescr',lang('Set
this to "old" for versions < 2.4, otherwise the exact mcrypt version you
use.'));
$setup_tpl->set_var('lang_mcryptiv',lang('MCrypt
initialization vector'));
- $setup_tpl->set_var('lang_mcryptivdescr',lang('This
should be around 30 bytes in length.<br>Note: The default has been randomly
generated.'));
+ $setup_tpl->set_var('lang_mcryptivdescr',lang('This
should be around 32 bytes in length.<br>Note: The default has been randomly
generated.'));
$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_mcrypt_key_descr',lang('This should be around
32 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-30 07:36:55 UTC (rev
16494)
+++ trunk/setup/templates/base/manageheader.tpl 2017-03-30 09:32:01 UTC (rev
16495)
@@ -66,7 +66,7 @@
</select>
</td>
</tr>
- <tr>
+ <!--tr>
<td colspan=2><b>{lang_enablemcrypt}</b><br>
<select name="setting[enable_mcrypt]">
<option value="True"{mcrypt_enabled_yes}>True
@@ -73,7 +73,7 @@
<option value="False"{mcrypt_enabled_no}>False
</select>
</td>
- </tr>
+ </tr-->
<tr>
<td><b>{lang_mcryptiv}</b><br><input type="text" name="setting[mcrypt_iv]"
value="{mcrypt_iv}" size="30"></td>
<td>{lang_mcryptivdescr}</td>
@@ -83,11 +83,6 @@
<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>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16495] preparing for php7.1,
sigurdne <=