[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14924] download parametres
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [14924] download parametres |
Date: |
Mon, 18 Apr 2016 18:16:40 +0000 |
Revision: 14924
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14924
Author: sigurdne
Date: 2016-04-18 18:16:39 +0000 (Mon, 18 Apr 2016)
Log Message:
-----------
download parametres
Modified Paths:
--------------
trunk/phpgwapi/inc/auth/class.auth_.inc.php
trunk/phpgwapi/setup/setup.inc.php
trunk/phpgwapi/setup/tables_current.inc.php
trunk/phpgwapi/setup/tables_update.inc.php
trunk/phpgwapi/templates/base/datatable_jquery.xsl
Modified: trunk/phpgwapi/inc/auth/class.auth_.inc.php
===================================================================
--- trunk/phpgwapi/inc/auth/class.auth_.inc.php 2016-04-18 13:15:47 UTC (rev
14923)
+++ trunk/phpgwapi/inc/auth/class.auth_.inc.php 2016-04-18 18:16:39 UTC (rev
14924)
@@ -4,7 +4,8 @@
* @author Dan Kuykendall <address@hidden>
* @author Joseph Engo <address@hidden>
* @author Philipp Kamps <address@hidden>
- * @copyright Copyright (C) 2000-2008 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2000-2016 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage accounts
@@ -83,7 +84,7 @@
}
$salt = substr(md5(uniqid(rand(), true)), 0, $chars);
- return $salt;
+ return $salt;
}
/**
@@ -94,11 +95,34 @@
*/
public function create_hash($passwd)
{
+ static $retry = 0;
switch
($GLOBALS['phpgw_info']['server']['encryption_type'])
{
case 'CRYPT':
- return '{CRYPT}' . crypt($passwd,
$this->_shake_salt(CRYPT_SALT_LENGTH));
+ $size =
mcrypt_get_iv_size(MCRYPT_CAST_256, MCRYPT_MODE_CFB);
+ $salt = mcrypt_create_iv($size,
MCRYPT_DEV_URANDOM);
+ $hash = crypt($passwd, '$5$' .
$salt);//CRYPT_SHA256
+ $ret = '{CRYPT}' . base64_encode($hash
. $salt);
+ $lenght_hash = strlen($hash);
+ /*
+ * It happens (about one out of 15 - 20
times) that the lenght is not as expexted
+ */
+
+ if($lenght_hash != 63 && $retry < 3)
+ {
+ if($retry < 3)
+ {
+ $retry++;
+ $ret =
self::create_hash($passwd);
+ }
+ else
+ {
+ throw new
Exception('Invalid lenght of password hash: ' . $lenght_hash);
+
+ }
+ }
+ return $ret;
case 'MD5':
return "{MD5}" .
base64_encode(phpgwapi_common::hex2bin(md5($passwd)));
@@ -137,8 +161,10 @@
switch ( strtoupper($algo) )
{
case 'CRYPT':
- //TODO implement this
- return false;
+ $hash = base64_decode($hash);
+ $salt = substr($hash, 63);
+ $hash = substr($hash, 0, 63);
+ return $hash === crypt($passwd, '$5$' .
$salt);
case 'MD5':
$hash = bin2hex(base64_decode($hash));
return $hash === md5($passwd);
Modified: trunk/phpgwapi/setup/setup.inc.php
===================================================================
--- trunk/phpgwapi/setup/setup.inc.php 2016-04-18 13:15:47 UTC (rev 14923)
+++ trunk/phpgwapi/setup/setup.inc.php 2016-04-18 18:16:39 UTC (rev 14924)
@@ -12,7 +12,7 @@
// Basic information about this app
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi';
- $setup_info['phpgwapi']['version'] = '0.9.17.548';
+ $setup_info['phpgwapi']['version'] = '0.9.17.549';
$setup_info['phpgwapi']['versions']['current_header'] = '1.31';
$setup_info['phpgwapi']['versions']['system'] = '2.0';
$setup_info['phpgwapi']['enable'] = 3;
Modified: trunk/phpgwapi/setup/tables_current.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_current.inc.php 2016-04-18 13:15:47 UTC (rev
14923)
+++ trunk/phpgwapi/setup/tables_current.inc.php 2016-04-18 18:16:39 UTC (rev
14924)
@@ -54,7 +54,7 @@
'fd' => array(
'account_id' => array('type' =>
'auto','nullable' => False),
'account_lid' => array('type' =>
'varchar','precision' => 25,'nullable' => False),
- 'account_pwd' => array('type' =>
'varchar','precision' => '40','nullable' => False),
+ 'account_pwd' => array('type' =>
'varchar','precision' => 115,'nullable' => False),
'account_firstname' => array('type' =>
'varchar','precision' => 50,'nullable' => False),
'account_lastname' => array('type' =>
'varchar','precision' => 50,'nullable' => False),
'account_permissions' => array('type' =>
'text','nullable' => True),
Modified: trunk/phpgwapi/setup/tables_update.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_update.inc.php 2016-04-18 13:15:47 UTC (rev
14923)
+++ trunk/phpgwapi/setup/tables_update.inc.php 2016-04-18 18:16:39 UTC (rev
14924)
@@ -3300,3 +3300,27 @@
}
}
+ $test[] = '0.9.17.548';
+ /**
+ * New password hash: salted crypt
+ * @return string the new version number
+ */
+ function phpgwapi_upgrade0_9_17_548()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_accounts',
'account_pwd', array
+ (
+ 'type' => 'varchar',
+ 'precision' => 115,
+ 'nullable' => false,
+ 'default' => ''
+ ));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['phpgwapi']['currentver'] =
'0.9.17.549';
+ return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+ }
+ }
+
Modified: trunk/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- trunk/phpgwapi/templates/base/datatable_jquery.xsl 2016-04-18 13:15:47 UTC
(rev 14923)
+++ trunk/phpgwapi/templates/base/datatable_jquery.xsl 2016-04-18 18:16:39 UTC
(rev 14924)
@@ -663,7 +663,8 @@
oParams.columns
= null;
oParams.start =
null;
oParams.draw =
null;
- var
addtional_filterdata = oTable.dataTableSettings[0]['ajax']['data'];
+ // var
addtional_filterdata = oTable.dataTableSettings[0]['ajax']['data'];
+ var
addtional_filterdata = oTable.dataTableSettings[0]['oAjaxData'];
for (var
attrname in addtional_filterdata)
{
oParams[attrname] = addtional_filterdata[attrname];
@@ -915,6 +916,11 @@
var sDom_def = '<"clear">lfrtip';
}
+ /*
+ * Find and assign actions to filters
+ */
+ var oControls =
$('.dtable_custom_controls:first').find(':input[name]');
+
$(document).ready(function() {
/*
@@ -941,11 +947,6 @@
menuaction += '_type_' +
table_url.searchObject.type;
}
- /*
- * Find and assign actions to filters
- */
- var oControls =
$('.dtable_custom_controls:first').find(':input[name]');
-//console.log(oControls);
oTable = $('#datatable-container').dataTable({
paginate: disablePagination ?
false : true,
processing: true,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14924] download parametres,
Sigurd Nes <=