BUG-15561 Cambiar el algoritmo o metodo de cifrado... SOLVED
- It don't have the functionality. - A function was add in class bootstrap hasPassword. - a function was add in class enterprise.
This commit is contained in:
@@ -2859,5 +2859,33 @@ class Bootstrap
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasPassword($pass, $previous=false) {
|
||||||
|
$passEncrypt = md5($pass);
|
||||||
|
try {
|
||||||
|
require_once PATH_CORE .'methods' . PATH_SEP .'enterprise/enterprise.php';
|
||||||
|
$passEncrypt = enterprisePlugin::hashPassword($pass, $previous);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
error_log('hasPassword bootstrap ' . $passEncrypt);
|
||||||
|
|
||||||
|
return $passEncrypt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function verifyHashPassword ($pass, $userPass)
|
||||||
|
{
|
||||||
|
//$verify = Bootstrap::hasPassword($pass);
|
||||||
|
error_log('contraseña config...');
|
||||||
|
if (Bootstrap::hasPassword($pass) == $userPass) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
error_log('contraseña anterior...');
|
||||||
|
if (Bootstrap::hasPassword($pass, true) == $userPass) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,10 +80,9 @@ class RbacUsers extends BaseRbacUsers
|
|||||||
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
|
if (is_array($rs) && isset($rs[0]) && is_object($rs[0]) && get_class($rs[0]) == 'RbacUsers') {
|
||||||
$aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
$aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
|
||||||
//verify password with md5, and md5 format
|
//verify password with md5, and md5 format
|
||||||
//if ( $aFields['USR_PASSWORD'] == md5 ($sPassword ) ) {
|
|
||||||
if (mb_strtoupper($sUsername, 'utf-8') === mb_strtoupper($aFields['USR_USERNAME'], 'utf-8')) {
|
if (mb_strtoupper($sUsername, 'utf-8') === mb_strtoupper($aFields['USR_USERNAME'], 'utf-8')) {
|
||||||
if ($aFields['USR_PASSWORD'] == md5($sPassword) ||
|
error_log('contraseña bbdd... '. $aFields['USR_PASSWORD']);
|
||||||
'md5:' . $aFields['USR_PASSWORD'] === $sPassword) {
|
if( Bootstrap::verifyHashPassword($sPassword, $aFields['USR_PASSWORD']) ) {
|
||||||
if ($aFields['USR_DUE_DATE'] < date('Y-m-d')) {
|
if ($aFields['USR_DUE_DATE'] < date('Y-m-d')) {
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ include_once 'creole/CreoleTypes.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class adds structure of 'USERS' table to 'rbac' DatabaseMap object.
|
* This class adds structure of 'RBAC_USERS' table to 'rbac' DatabaseMap object.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@@ -14,9 +14,10 @@ include_once 'creole/CreoleTypes.php';
|
|||||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||||
* (i.e. if it's a text column type).
|
* (i.e. if it's a text column type).
|
||||||
*
|
*
|
||||||
* @package rbac-classes-model
|
* @package workflow.classes.model.map
|
||||||
*/
|
*/
|
||||||
class RbacUsersMapBuilder {
|
class RbacUsersMapBuilder
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The (dot-path) name of this class
|
* The (dot-path) name of this class
|
||||||
@@ -68,7 +69,7 @@ class RbacUsersMapBuilder {
|
|||||||
|
|
||||||
$tMap->addColumn('USR_USERNAME', 'UsrUsername', 'string', CreoleTypes::VARCHAR, true, 100);
|
$tMap->addColumn('USR_USERNAME', 'UsrUsername', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||||
|
|
||||||
$tMap->addColumn('USR_PASSWORD', 'UsrPassword', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addColumn('USR_PASSWORD', 'UsrPassword', 'string', CreoleTypes::VARCHAR, true, 128);
|
||||||
|
|
||||||
$tMap->addColumn('USR_FIRSTNAME', 'UsrFirstname', 'string', CreoleTypes::VARCHAR, true, 50);
|
$tMap->addColumn('USR_FIRSTNAME', 'UsrFirstname', 'string', CreoleTypes::VARCHAR, true, 50);
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ include_once 'propel/util/Criteria.php';
|
|||||||
include_once 'classes/model/RbacUsersPeer.php';
|
include_once 'classes/model/RbacUsersPeer.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class that represents a row from the 'USERS' table.
|
* Base class that represents a row from the 'RBAC_USERS' table.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @package rbac-classes-model
|
* @package workflow.classes.model.om
|
||||||
*/
|
*/
|
||||||
abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
abstract class BaseRbacUsers extends BaseObject implements Persistent
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Peer class.
|
* The Peer class.
|
||||||
@@ -27,98 +27,84 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
*/
|
*/
|
||||||
protected static $peer;
|
protected static $peer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_uid field.
|
* The value for the usr_uid field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_uid = '';
|
protected $usr_uid = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_username field.
|
* The value for the usr_username field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_username = '';
|
protected $usr_username = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_password field.
|
* The value for the usr_password field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_password = '';
|
protected $usr_password = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_firstname field.
|
* The value for the usr_firstname field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_firstname = '';
|
protected $usr_firstname = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_lastname field.
|
* The value for the usr_lastname field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_lastname = '';
|
protected $usr_lastname = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_email field.
|
* The value for the usr_email field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_email = '';
|
protected $usr_email = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_due_date field.
|
* The value for the usr_due_date field.
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $usr_due_date;
|
protected $usr_due_date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_create_date field.
|
* The value for the usr_create_date field.
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $usr_create_date;
|
protected $usr_create_date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_update_date field.
|
* The value for the usr_update_date field.
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $usr_update_date;
|
protected $usr_update_date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_status field.
|
* The value for the usr_status field.
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $usr_status = 1;
|
protected $usr_status = 1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_auth_type field.
|
* The value for the usr_auth_type field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_auth_type = '';
|
protected $usr_auth_type = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the uid_auth_source field.
|
* The value for the uid_auth_source field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $uid_auth_source = '';
|
protected $uid_auth_source = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_auth_user_dn field.
|
* The value for the usr_auth_user_dn field.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $usr_auth_user_dn = '';
|
protected $usr_auth_user_dn = '';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the usr_auth_supervisor_dn field.
|
* The value for the usr_auth_supervisor_dn field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -221,8 +207,9 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
} elseif (!is_int($this->usr_due_date)) {
|
} elseif (!is_int($this->usr_due_date)) {
|
||||||
// a non-timestamp value was set externally, so we convert it
|
// a non-timestamp value was set externally, so we convert it
|
||||||
$ts = strtotime($this->usr_due_date);
|
$ts = strtotime($this->usr_due_date);
|
||||||
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
|
if ($ts === -1 || $ts === false) {
|
||||||
throw new PropelException("Unable to parse value of [usr_due_date] as date/time value: " . var_export($this->usr_due_date, true));
|
throw new PropelException("Unable to parse value of [usr_due_date] as date/time value: " .
|
||||||
|
var_export($this->usr_due_date, true));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ts = $this->usr_due_date;
|
$ts = $this->usr_due_date;
|
||||||
@@ -252,8 +239,9 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
} elseif (!is_int($this->usr_create_date)) {
|
} elseif (!is_int($this->usr_create_date)) {
|
||||||
// a non-timestamp value was set externally, so we convert it
|
// a non-timestamp value was set externally, so we convert it
|
||||||
$ts = strtotime($this->usr_create_date);
|
$ts = strtotime($this->usr_create_date);
|
||||||
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
|
if ($ts === -1 || $ts === false) {
|
||||||
throw new PropelException("Unable to parse value of [usr_create_date] as date/time value: " . var_export($this->usr_create_date, true));
|
throw new PropelException("Unable to parse value of [usr_create_date] as date/time value: " .
|
||||||
|
var_export($this->usr_create_date, true));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ts = $this->usr_create_date;
|
$ts = $this->usr_create_date;
|
||||||
@@ -283,8 +271,9 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
} elseif (!is_int($this->usr_update_date)) {
|
} elseif (!is_int($this->usr_update_date)) {
|
||||||
// a non-timestamp value was set externally, so we convert it
|
// a non-timestamp value was set externally, so we convert it
|
||||||
$ts = strtotime($this->usr_update_date);
|
$ts = strtotime($this->usr_update_date);
|
||||||
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
|
if ($ts === -1 || $ts === false) {
|
||||||
throw new PropelException("Unable to parse value of [usr_update_date] as date/time value: " . var_export($this->usr_update_date, true));
|
throw new PropelException("Unable to parse value of [usr_update_date] as date/time value: " .
|
||||||
|
var_export($this->usr_update_date, true));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ts = $this->usr_update_date;
|
$ts = $this->usr_update_date;
|
||||||
@@ -496,8 +485,13 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
|
|
||||||
if ($v !== null && !is_int($v)) {
|
if ($v !== null && !is_int($v)) {
|
||||||
$ts = strtotime($v);
|
$ts = strtotime($v);
|
||||||
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
|
//Date/time accepts null values
|
||||||
throw new PropelException("Unable to parse date/time value for [usr_due_date] from input: " . var_export($v, true));
|
if ($v == '') {
|
||||||
|
$ts = null;
|
||||||
|
}
|
||||||
|
if ($ts === -1 || $ts === false) {
|
||||||
|
throw new PropelException("Unable to parse date/time value for [usr_due_date] from input: " .
|
||||||
|
var_export($v, true));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ts = $v;
|
$ts = $v;
|
||||||
@@ -520,8 +514,13 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
|
|
||||||
if ($v !== null && !is_int($v)) {
|
if ($v !== null && !is_int($v)) {
|
||||||
$ts = strtotime($v);
|
$ts = strtotime($v);
|
||||||
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
|
//Date/time accepts null values
|
||||||
throw new PropelException("Unable to parse date/time value for [usr_create_date] from input: " . var_export($v, true));
|
if ($v == '') {
|
||||||
|
$ts = null;
|
||||||
|
}
|
||||||
|
if ($ts === -1 || $ts === false) {
|
||||||
|
throw new PropelException("Unable to parse date/time value for [usr_create_date] from input: " .
|
||||||
|
var_export($v, true));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ts = $v;
|
$ts = $v;
|
||||||
@@ -544,8 +543,13 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
|
|
||||||
if ($v !== null && !is_int($v)) {
|
if ($v !== null && !is_int($v)) {
|
||||||
$ts = strtotime($v);
|
$ts = strtotime($v);
|
||||||
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
|
//Date/time accepts null values
|
||||||
throw new PropelException("Unable to parse date/time value for [usr_update_date] from input: " . var_export($v, true));
|
if ($v == '') {
|
||||||
|
$ts = null;
|
||||||
|
}
|
||||||
|
if ($ts === -1 || $ts === false) {
|
||||||
|
throw new PropelException("Unable to parse date/time value for [usr_update_date] from input: " .
|
||||||
|
var_export($v, true));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ts = $v;
|
$ts = $v;
|
||||||
@@ -760,7 +764,7 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
* wraps the doSave() worker method in a transaction.
|
* wraps the doSave() worker method in a transaction.
|
||||||
*
|
*
|
||||||
* @param Connection $con
|
* @param Connection $con
|
||||||
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
|
* @return int The number of rows affected by this insert/update
|
||||||
* @throws PropelException
|
* @throws PropelException
|
||||||
* @see doSave()
|
* @see doSave()
|
||||||
*/
|
*/
|
||||||
@@ -792,7 +796,7 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
* All related objects are also updated in this method.
|
* All related objects are also updated in this method.
|
||||||
*
|
*
|
||||||
* @param Connection $con
|
* @param Connection $con
|
||||||
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
|
* @return int The number of rows affected by this insert/update and any referring
|
||||||
* @throws PropelException
|
* @throws PropelException
|
||||||
* @see save()
|
* @see save()
|
||||||
*/
|
*/
|
||||||
@@ -872,7 +876,8 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
* an aggreagated array of ValidationFailed objects will be returned.
|
* an aggreagated array of ValidationFailed objects will be returned.
|
||||||
*
|
*
|
||||||
* @param array $columns Array of column names to validate.
|
* @param array $columns Array of column names to validate.
|
||||||
* @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
|
* @return mixed <code>true</code> if all validations pass;
|
||||||
|
array of <code>ValidationFailed</code> objects otherwise.
|
||||||
*/
|
*/
|
||||||
protected function doValidate($columns = null)
|
protected function doValidate($columns = null)
|
||||||
{
|
{
|
||||||
@@ -1092,20 +1097,62 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
{
|
{
|
||||||
$keys = RbacUsersPeer::getFieldNames($keyType);
|
$keys = RbacUsersPeer::getFieldNames($keyType);
|
||||||
|
|
||||||
if (array_key_exists($keys[0], $arr)) $this->setUsrUid($arr[$keys[0]]);
|
if (array_key_exists($keys[0], $arr)) {
|
||||||
if (array_key_exists($keys[1], $arr)) $this->setUsrUsername($arr[$keys[1]]);
|
$this->setUsrUid($arr[$keys[0]]);
|
||||||
if (array_key_exists($keys[2], $arr)) $this->setUsrPassword($arr[$keys[2]]);
|
}
|
||||||
if (array_key_exists($keys[3], $arr)) $this->setUsrFirstname($arr[$keys[3]]);
|
|
||||||
if (array_key_exists($keys[4], $arr)) $this->setUsrLastname($arr[$keys[4]]);
|
if (array_key_exists($keys[1], $arr)) {
|
||||||
if (array_key_exists($keys[5], $arr)) $this->setUsrEmail($arr[$keys[5]]);
|
$this->setUsrUsername($arr[$keys[1]]);
|
||||||
if (array_key_exists($keys[6], $arr)) $this->setUsrDueDate($arr[$keys[6]]);
|
}
|
||||||
if (array_key_exists($keys[7], $arr)) $this->setUsrCreateDate($arr[$keys[7]]);
|
|
||||||
if (array_key_exists($keys[8], $arr)) $this->setUsrUpdateDate($arr[$keys[8]]);
|
if (array_key_exists($keys[2], $arr)) {
|
||||||
if (array_key_exists($keys[9], $arr)) $this->setUsrStatus($arr[$keys[9]]);
|
$this->setUsrPassword($arr[$keys[2]]);
|
||||||
if (array_key_exists($keys[10], $arr)) $this->setUsrAuthType($arr[$keys[10]]);
|
}
|
||||||
if (array_key_exists($keys[11], $arr)) $this->setUidAuthSource($arr[$keys[11]]);
|
|
||||||
if (array_key_exists($keys[12], $arr)) $this->setUsrAuthUserDn($arr[$keys[12]]);
|
if (array_key_exists($keys[3], $arr)) {
|
||||||
if (array_key_exists($keys[13], $arr)) $this->setUsrAuthSupervisorDn($arr[$keys[13]]);
|
$this->setUsrFirstname($arr[$keys[3]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[4], $arr)) {
|
||||||
|
$this->setUsrLastname($arr[$keys[4]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[5], $arr)) {
|
||||||
|
$this->setUsrEmail($arr[$keys[5]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[6], $arr)) {
|
||||||
|
$this->setUsrDueDate($arr[$keys[6]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[7], $arr)) {
|
||||||
|
$this->setUsrCreateDate($arr[$keys[7]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[8], $arr)) {
|
||||||
|
$this->setUsrUpdateDate($arr[$keys[8]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[9], $arr)) {
|
||||||
|
$this->setUsrStatus($arr[$keys[9]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[10], $arr)) {
|
||||||
|
$this->setUsrAuthType($arr[$keys[10]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[11], $arr)) {
|
||||||
|
$this->setUidAuthSource($arr[$keys[11]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[12], $arr)) {
|
||||||
|
$this->setUsrAuthUserDn($arr[$keys[12]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[13], $arr)) {
|
||||||
|
$this->setUsrAuthSupervisorDn($arr[$keys[13]]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1117,20 +1164,62 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
{
|
{
|
||||||
$criteria = new Criteria(RbacUsersPeer::DATABASE_NAME);
|
$criteria = new Criteria(RbacUsersPeer::DATABASE_NAME);
|
||||||
|
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_UID)) $criteria->add(RbacUsersPeer::USR_UID, $this->usr_uid);
|
if ($this->isColumnModified(RbacUsersPeer::USR_UID)) {
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_USERNAME)) $criteria->add(RbacUsersPeer::USR_USERNAME, $this->usr_username);
|
$criteria->add(RbacUsersPeer::USR_UID, $this->usr_uid);
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_PASSWORD)) $criteria->add(RbacUsersPeer::USR_PASSWORD, $this->usr_password);
|
}
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_FIRSTNAME)) $criteria->add(RbacUsersPeer::USR_FIRSTNAME, $this->usr_firstname);
|
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_LASTNAME)) $criteria->add(RbacUsersPeer::USR_LASTNAME, $this->usr_lastname);
|
if ($this->isColumnModified(RbacUsersPeer::USR_USERNAME)) {
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_EMAIL)) $criteria->add(RbacUsersPeer::USR_EMAIL, $this->usr_email);
|
$criteria->add(RbacUsersPeer::USR_USERNAME, $this->usr_username);
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_DUE_DATE)) $criteria->add(RbacUsersPeer::USR_DUE_DATE, $this->usr_due_date);
|
}
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_CREATE_DATE)) $criteria->add(RbacUsersPeer::USR_CREATE_DATE, $this->usr_create_date);
|
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_UPDATE_DATE)) $criteria->add(RbacUsersPeer::USR_UPDATE_DATE, $this->usr_update_date);
|
if ($this->isColumnModified(RbacUsersPeer::USR_PASSWORD)) {
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_STATUS)) $criteria->add(RbacUsersPeer::USR_STATUS, $this->usr_status);
|
$criteria->add(RbacUsersPeer::USR_PASSWORD, $this->usr_password);
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_AUTH_TYPE)) $criteria->add(RbacUsersPeer::USR_AUTH_TYPE, $this->usr_auth_type);
|
}
|
||||||
if ($this->isColumnModified(RbacUsersPeer::UID_AUTH_SOURCE)) $criteria->add(RbacUsersPeer::UID_AUTH_SOURCE, $this->uid_auth_source);
|
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_AUTH_USER_DN)) $criteria->add(RbacUsersPeer::USR_AUTH_USER_DN, $this->usr_auth_user_dn);
|
if ($this->isColumnModified(RbacUsersPeer::USR_FIRSTNAME)) {
|
||||||
if ($this->isColumnModified(RbacUsersPeer::USR_AUTH_SUPERVISOR_DN)) $criteria->add(RbacUsersPeer::USR_AUTH_SUPERVISOR_DN, $this->usr_auth_supervisor_dn);
|
$criteria->add(RbacUsersPeer::USR_FIRSTNAME, $this->usr_firstname);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_LASTNAME)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_LASTNAME, $this->usr_lastname);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_EMAIL)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_EMAIL, $this->usr_email);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_DUE_DATE)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_DUE_DATE, $this->usr_due_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_CREATE_DATE)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_CREATE_DATE, $this->usr_create_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_UPDATE_DATE)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_UPDATE_DATE, $this->usr_update_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_STATUS)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_STATUS, $this->usr_status);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_AUTH_TYPE)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_AUTH_TYPE, $this->usr_auth_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::UID_AUTH_SOURCE)) {
|
||||||
|
$criteria->add(RbacUsersPeer::UID_AUTH_SOURCE, $this->uid_auth_source);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_AUTH_USER_DN)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_AUTH_USER_DN, $this->usr_auth_user_dn);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(RbacUsersPeer::USR_AUTH_SUPERVISOR_DN)) {
|
||||||
|
$criteria->add(RbacUsersPeer::USR_AUTH_SUPERVISOR_DN, $this->usr_auth_supervisor_dn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
@@ -1255,5 +1344,5 @@ abstract class BaseRbacUsers extends BaseObject implements Persistent {
|
|||||||
}
|
}
|
||||||
return self::$peer;
|
return self::$peer;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // BaseRbacUsers
|
|
||||||
|
|||||||
@@ -3,16 +3,17 @@
|
|||||||
require_once 'propel/util/BasePeer.php';
|
require_once 'propel/util/BasePeer.php';
|
||||||
// The object class -- needed for instanceof checks in this class.
|
// The object class -- needed for instanceof checks in this class.
|
||||||
// actual class may be a subclass -- as returned by RbacUsersPeer::getOMClass()
|
// actual class may be a subclass -- as returned by RbacUsersPeer::getOMClass()
|
||||||
//include_once 'classes/model/RbacUsers.php';
|
include_once 'classes/model/RbacUsers.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base static class for performing query and update operations on the 'USERS' table.
|
* Base static class for performing query and update operations on the 'RBAC_USERS' table.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @package rbac-classes-model
|
* @package workflow.classes.model.om
|
||||||
*/
|
*/
|
||||||
abstract class BaseRbacUsersPeer {
|
abstract class BaseRbacUsersPeer
|
||||||
|
{
|
||||||
|
|
||||||
/** the default database name for this class */
|
/** the default database name for this class */
|
||||||
const DATABASE_NAME = 'rbac';
|
const DATABASE_NAME = 'rbac';
|
||||||
@@ -255,8 +256,7 @@ abstract class BaseRbacUsersPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// just in case we're grouping: add those columns to the select statement
|
// just in case we're grouping: add those columns to the select statement
|
||||||
foreach($criteria->getGroupByColumns() as $column)
|
foreach ($criteria->getGroupByColumns() as $column) {
|
||||||
{
|
|
||||||
$criteria->addSelectColumn($column);
|
$criteria->addSelectColumn($column);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ abstract class BaseRbacUsersPeer {
|
|||||||
$cls = RbacUsersPeer::getOMClass();
|
$cls = RbacUsersPeer::getOMClass();
|
||||||
$cls = Propel::import($cls);
|
$cls = Propel::import($cls);
|
||||||
// populate the object(s)
|
// populate the object(s)
|
||||||
while($rs->next()) {
|
while ($rs->next()) {
|
||||||
|
|
||||||
$obj = new $cls();
|
$obj = new $cls();
|
||||||
$obj->hydrate($rs);
|
$obj->hydrate($rs);
|
||||||
@@ -413,7 +413,7 @@ abstract class BaseRbacUsersPeer {
|
|||||||
$con->begin();
|
$con->begin();
|
||||||
$pk = BasePeer::doInsert($criteria, $con);
|
$pk = BasePeer::doInsert($criteria, $con);
|
||||||
$con->commit();
|
$con->commit();
|
||||||
} catch(PropelException $e) {
|
} catch (PropelException $e) {
|
||||||
$con->rollback();
|
$con->rollback();
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
@@ -424,8 +424,8 @@ abstract class BaseRbacUsersPeer {
|
|||||||
/**
|
/**
|
||||||
* Method perform an UPDATE on the database, given a RbacUsers or Criteria object.
|
* Method perform an UPDATE on the database, given a RbacUsers or Criteria object.
|
||||||
*
|
*
|
||||||
* @param mixed $values Criteria or RbacUsers object containing data that is used to create the UPDATE statement.
|
* @param mixed $values Criteria or RbacUsers object containing data create the UPDATE statement.
|
||||||
* @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
|
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||||
* @return int The number of affected rows (if supported by underlying database driver).
|
* @return int The number of affected rows (if supported by underlying database driver).
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
* rethrown wrapped into a PropelException.
|
* rethrown wrapped into a PropelException.
|
||||||
@@ -444,7 +444,7 @@ abstract class BaseRbacUsersPeer {
|
|||||||
$comparison = $criteria->getComparison(RbacUsersPeer::USR_UID);
|
$comparison = $criteria->getComparison(RbacUsersPeer::USR_UID);
|
||||||
$selectCriteria->add(RbacUsersPeer::USR_UID, $criteria->remove(RbacUsersPeer::USR_UID), $comparison);
|
$selectCriteria->add(RbacUsersPeer::USR_UID, $criteria->remove(RbacUsersPeer::USR_UID), $comparison);
|
||||||
|
|
||||||
} else { // $values is RbacUsers object
|
} else {
|
||||||
$criteria = $values->buildCriteria(); // gets full criteria
|
$criteria = $values->buildCriteria(); // gets full criteria
|
||||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||||
}
|
}
|
||||||
@@ -456,7 +456,7 @@ abstract class BaseRbacUsersPeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to DELETE all rows from the USERS table.
|
* Method to DELETE all rows from the RBAC_USERS table.
|
||||||
*
|
*
|
||||||
* @return int The number of affected rows (if supported by underlying database driver).
|
* @return int The number of affected rows (if supported by underlying database driver).
|
||||||
*/
|
*/
|
||||||
@@ -485,7 +485,8 @@ abstract class BaseRbacUsersPeer {
|
|||||||
* @param mixed $values Criteria or RbacUsers object or primary key or array of primary keys
|
* @param mixed $values Criteria or RbacUsers object or primary key or array of primary keys
|
||||||
* which is used to create the DELETE statement
|
* which is used to create the DELETE statement
|
||||||
* @param Connection $con the connection to use
|
* @param Connection $con the connection to use
|
||||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
* @return int The number of affected rows (if supported by underlying database driver).
|
||||||
|
* This includes CASCADE-related rows
|
||||||
* if supported by native driver or if emulated using Propel.
|
* if supported by native driver or if emulated using Propel.
|
||||||
* @throws PropelException Any exceptions caught during processing will be
|
* @throws PropelException Any exceptions caught during processing will be
|
||||||
* rethrown wrapped into a PropelException.
|
* rethrown wrapped into a PropelException.
|
||||||
@@ -550,7 +551,7 @@ abstract class BaseRbacUsersPeer {
|
|||||||
$cols = array($cols);
|
$cols = array($cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($cols as $colName) {
|
foreach ($cols as $colName) {
|
||||||
if ($tableMap->containsColumn($colName)) {
|
if ($tableMap->containsColumn($colName)) {
|
||||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||||
$columns[$colName] = $obj->$get();
|
$columns[$colName] = $obj->$get();
|
||||||
@@ -610,8 +611,8 @@ abstract class BaseRbacUsersPeer {
|
|||||||
}
|
}
|
||||||
return $objs;
|
return $objs;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // BaseRbacUsersPeer
|
|
||||||
|
|
||||||
// static code to register the map builder for this Peer with the main Propel class
|
// static code to register the map builder for this Peer with the main Propel class
|
||||||
if (Propel::isInit()) {
|
if (Propel::isInit()) {
|
||||||
@@ -628,3 +629,4 @@ if (Propel::isInit()) {
|
|||||||
require_once 'classes/model/map/RbacUsersMapBuilder.php';
|
require_once 'classes/model/map/RbacUsersMapBuilder.php';
|
||||||
Propel::registerMapBuilder('classes.model.map.RbacUsersMapBuilder');
|
Propel::registerMapBuilder('classes.model.map.RbacUsersMapBuilder');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
</vendor>
|
</vendor>
|
||||||
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
||||||
<column name="USR_USERNAME" type="VARCHAR" size="100" required="true" default="" />
|
<column name="USR_USERNAME" type="VARCHAR" size="100" required="true" default="" />
|
||||||
<column name="USR_PASSWORD" type="VARCHAR" size="32" required="true" default="" />
|
<column name="USR_PASSWORD" type="VARCHAR" size="128" required="true" default="" />
|
||||||
<column name="USR_FIRSTNAME" type="VARCHAR" size="50" required="true" default="" />
|
<column name="USR_FIRSTNAME" type="VARCHAR" size="50" required="true" default="" />
|
||||||
<column name="USR_LASTNAME" type="VARCHAR" size="50" required="true" default="" />
|
<column name="USR_LASTNAME" type="VARCHAR" size="50" required="true" default="" />
|
||||||
<column name="USR_EMAIL" type="VARCHAR" size="100" required="true" default="" />
|
<column name="USR_EMAIL" type="VARCHAR" size="100" required="true" default="" />
|
||||||
|
|||||||
@@ -19,6 +19,15 @@ EOT
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
CLI::taskName('change-password-hash-method');
|
||||||
|
CLI::taskDescription(<<<EOT
|
||||||
|
Create .po file for the plugin
|
||||||
|
EOT
|
||||||
|
);
|
||||||
|
CLI::taskArg('workspace', false);
|
||||||
|
CLI::taskArg('hash', false);
|
||||||
|
CLI::taskRun("change_hash");
|
||||||
|
|
||||||
//function run_addon_install($args, $opts) {
|
//function run_addon_install($args, $opts) {
|
||||||
function run_addon_install($args)
|
function run_addon_install($args)
|
||||||
{
|
{
|
||||||
@@ -92,3 +101,46 @@ function run_addon_install($args)
|
|||||||
//echo "** Installation finished\n";
|
//echo "** Installation finished\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function change_hash($command, $opts)
|
||||||
|
{
|
||||||
|
if (count($command) < 2) {
|
||||||
|
$hash = 'md5';
|
||||||
|
} else {
|
||||||
|
$hash = array_pop($command);
|
||||||
|
}
|
||||||
|
$workspaces = get_workspaces_from_args($command);
|
||||||
|
|
||||||
|
require_once (PATH_GULLIVER . PATH_SEP . 'class.bootstrap.php');
|
||||||
|
Bootstrap::LoadClass("plugin");
|
||||||
|
foreach ($workspaces as $workspace) {
|
||||||
|
CLI::logging("Checking workspace: ".pakeColor::colorize($workspace->name, "INFO")."\n");
|
||||||
|
$path = PATH_DATA . 'sites' . PATH_SEP . $workspace->name . PATH_SEP;
|
||||||
|
try {
|
||||||
|
if (file_exists($path . 'plugin.singleton')) {
|
||||||
|
define('SYS_SYS', $workspace->name);
|
||||||
|
define('PATH_DATA_SITE', $path);
|
||||||
|
|
||||||
|
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||||
|
$oPluginRegistry->setupPlugins();
|
||||||
|
$oPluginRegistry->unSerializeInstance(file_get_contents($path . 'plugin.singleton'));
|
||||||
|
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||||
|
$oPluginRegistry->unSerializeInstance(file_get_contents($path . 'plugin.singleton'));
|
||||||
|
|
||||||
|
if ($oPluginRegistry->existsTrigger ( PM_HASH_PASSWORD )) {
|
||||||
|
$response = new stdclass();
|
||||||
|
$response->workspace = $workspace;
|
||||||
|
$response->hash = $hash;
|
||||||
|
$workspace->changeHashPassword($workspace->name, $response);
|
||||||
|
$workspace->close();
|
||||||
|
CLI::logging(pakeColor::colorize("Changed...", "ERROR") . "\n");
|
||||||
|
} else {
|
||||||
|
CLI::logging(pakeColor::colorize("You can't use the \"change-password-hash-method\" option because the license has expired or your workspace doesn't have the Enteprise plugin enabled.", "ERROR") . "\n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CLI::logging(pakeColor::colorize("You can't use the \"change-password-hash-method\" option because the license has expired or your workspace doesn't have the Enteprise plugin enabled.", "INFO") . "\n");
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once (PATH_PLUGINS . "enterprise" . PATH_SEP . "classes" . PATH_SEP . "class.enterpriseUtils.php");
|
require_once ("classes" . PATH_SEP . "class.enterpriseUtils.php");
|
||||||
|
|
||||||
if (!defined("PM_VERSION")) {
|
if (!defined("PM_VERSION")) {
|
||||||
if (file_exists(PATH_METHODS . "login/version-pmos.php")) {
|
if (file_exists(PATH_METHODS . "login/version-pmos.php")) {
|
||||||
@@ -13,7 +13,7 @@ class enterpriseClass extends PMPlugin
|
|||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
set_include_path(PATH_PLUGINS . 'enterprise' . PATH_SEPARATOR . get_include_path());
|
set_include_path(PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEPARATOR . get_include_path());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFieldsForPageSetup()
|
public function getFieldsForPageSetup()
|
||||||
@@ -117,9 +117,48 @@ class enterpriseClass extends PMPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setHashPassword ($object)
|
||||||
|
{
|
||||||
|
$type = array('md5', 'sha256');
|
||||||
|
if (!in_array($object->hash, $type)) {
|
||||||
|
throw new Exception( 'Type: ' . $object->hash. ' No valid.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
G::LoadClass( "configuration" );
|
||||||
|
$config = new Configurations();
|
||||||
|
$typeEncrypt = $config->getConfiguration('ENTERPRISE_SETTING_ENCRYPT', '');
|
||||||
|
if ($typeEncrypt == null) {
|
||||||
|
$typeEncrypt = array('current' => $object->hash, 'previous' => 'md5');
|
||||||
|
} else {
|
||||||
|
$typeEncrypt['previous'] = $typeEncrypt['current'];
|
||||||
|
$typeEncrypt['current'] = $object->hash;
|
||||||
|
}
|
||||||
|
if ($object->hash != $typeEncrypt['previous']) {
|
||||||
|
$config->aConfig = $typeEncrypt;
|
||||||
|
$config->saveConfig('ENTERPRISE_SETTING_ENCRYPT', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once 'classes/model/RbacUsersPeer.php';
|
||||||
|
require_once 'classes/model/UsersProperties.php';
|
||||||
|
$userProperty = new UsersProperties();
|
||||||
|
|
||||||
|
$criteria = new Criteria($object->workspace->dbInfo['DB_RBAC_NAME']);
|
||||||
|
$criteria->add(RbacUsersPeer::USR_STATUS, 0, Criteria::NOT_EQUAL);
|
||||||
|
$dataset = RbacUsersPeer::doSelectRS($criteria);
|
||||||
|
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
while ($dataset->next()) {
|
||||||
|
$row = $dataset->getRow();
|
||||||
|
$property = $userProperty->loadOrCreateIfNotExists($row['USR_UID'], array());
|
||||||
|
$property['USR_LOGGED_NEXT_TIME'] = 1;
|
||||||
|
$userProperty->update($property);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists("pmLicenseManager")) {
|
if (!class_exists("pmLicenseManager")) {
|
||||||
require_once (PATH_PLUGINS . 'enterprise/class.pmLicenseManager.php');
|
require_once ("classes" . PATH_SEP . "class.pmLicenseManager.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ define('PM_SINGLE_SIGN_ON', 1014);
|
|||||||
define('PM_GET_CASES_AJAX_LISTENER', 1015);
|
define('PM_GET_CASES_AJAX_LISTENER', 1015);
|
||||||
define('PM_BEFORE_CREATE_USER', 1016);
|
define('PM_BEFORE_CREATE_USER', 1016);
|
||||||
define('PM_AFTER_LOGIN', 1017);
|
define('PM_AFTER_LOGIN', 1017);
|
||||||
|
define('PM_HASH_PASSWORD', 1018);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package workflow.engine.classes
|
* @package workflow.engine.classes
|
||||||
|
|||||||
@@ -985,7 +985,7 @@ class PMPluginRegistry
|
|||||||
$classFile = '';
|
$classFile = '';
|
||||||
|
|
||||||
foreach ($this->_aFolders as $row => $folder) {
|
foreach ($this->_aFolders as $row => $folder) {
|
||||||
$fname = PATH_PLUGINS . $folder->sFolderName . PATH_SEP . 'class.' . $folder->sFolderName . '.php';
|
$fname = $folder->sNamespace == 'enterprise' ? PATH_CORE . 'classes' . PATH_SEP . 'class.' . $folder->sFolderName . '.php' : PATH_PLUGINS . $folder->sFolderName . PATH_SEP . 'class.' . $folder->sFolderName . '.php';
|
||||||
if ($detail->sNamespace == $folder->sNamespace && file_exists( $fname )) {
|
if ($detail->sNamespace == $folder->sNamespace && file_exists( $fname )) {
|
||||||
$found = true;
|
$found = true;
|
||||||
$classFile = $fname;
|
$classFile = $fname;
|
||||||
@@ -1021,11 +1021,12 @@ class PMPluginRegistry
|
|||||||
if ($triggerId == $detail->sTriggerId) {
|
if ($triggerId == $detail->sTriggerId) {
|
||||||
//review all folders registered for this namespace
|
//review all folders registered for this namespace
|
||||||
foreach ($this->_aFolders as $row => $folder) {
|
foreach ($this->_aFolders as $row => $folder) {
|
||||||
$fname = PATH_PLUGINS . $folder->sFolderName . PATH_SEP . 'class.' . $folder->sFolderName . '.php';
|
$fname = $folder->sNamespace == 'enterprise' ? PATH_CORE . 'classes' . PATH_SEP . 'class.' . $folder->sFolderName . '.php' : PATH_PLUGINS . $folder->sFolderName . PATH_SEP . 'class.' . $folder->sFolderName . '.php';
|
||||||
if ($detail->sNamespace == $folder->sNamespace && file_exists( $fname )) {
|
if ($detail->sNamespace == $folder->sNamespace && file_exists( $fname )) {
|
||||||
$found = true;
|
$found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $found;
|
return $found;
|
||||||
|
|||||||
@@ -1189,7 +1189,7 @@ class wsBase
|
|||||||
$arrayData = array ();
|
$arrayData = array ();
|
||||||
|
|
||||||
$arrayData["USR_USERNAME"] = $userName;
|
$arrayData["USR_USERNAME"] = $userName;
|
||||||
$arrayData["USR_PASSWORD"] = md5( $password );
|
$arrayData["USR_PASSWORD"] = Bootstrap::hasPassword( $password );
|
||||||
$arrayData["USR_FIRSTNAME"] = $firstName;
|
$arrayData["USR_FIRSTNAME"] = $firstName;
|
||||||
$arrayData["USR_LASTNAME"] = $lastName;
|
$arrayData["USR_LASTNAME"] = $lastName;
|
||||||
$arrayData["USR_EMAIL"] = $email;
|
$arrayData["USR_EMAIL"] = $email;
|
||||||
@@ -1380,7 +1380,7 @@ class wsBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! empty( $password )) {
|
if (! empty( $password )) {
|
||||||
$arrayData["USR_PASSWORD"] = md5( $password );
|
$arrayData["USR_PASSWORD"] = Bootstrap::hasPassword( $password );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update user
|
//Update user
|
||||||
|
|||||||
@@ -1566,5 +1566,12 @@ class workspaceTools
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function changeHashPassword ($workspace,$response) {
|
||||||
|
G::LoadClass("patch");
|
||||||
|
$this->initPropel( true );
|
||||||
|
|
||||||
|
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||||
|
$oPluginRegistry->executeTriggers ( PM_HASH_PASSWORD , $response );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ class Installer extends Controller
|
|||||||
$info->pathLogFile->result = file_exists( $_REQUEST['pathLogFile'] );
|
$info->pathLogFile->result = file_exists( $_REQUEST['pathLogFile'] );
|
||||||
|
|
||||||
if ($info->pathLogFile->result) {
|
if ($info->pathLogFile->result) {
|
||||||
$info->pathLogFile->message = G::LoadTranslation('ID_INSTALLATION_LOG');
|
$info->pathLogFile->message = G::LoadTranslation('ID_INSTALLATION_FILE_LOG');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($info->success) {
|
if ($info->success) {
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ class Main extends Controller
|
|||||||
$newPass = G::generate_password();
|
$newPass = G::generate_password();
|
||||||
|
|
||||||
$aData['USR_UID'] = $userData['USR_UID'];
|
$aData['USR_UID'] = $userData['USR_UID'];
|
||||||
$aData['USR_PASSWORD'] = md5( $newPass );
|
$aData['USR_PASSWORD'] = Bootstrap::hasPassword( $newPass );
|
||||||
|
|
||||||
$rbacUser->update( $aData );
|
$rbacUser->update( $aData );
|
||||||
$user->update( $aData );
|
$user->update( $aData );
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enter
|
|||||||
$enterprise = new enterprisePlugin('enterprise');
|
$enterprise = new enterprisePlugin('enterprise');
|
||||||
|
|
||||||
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
|
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
|
||||||
|
$enterprise->install();
|
||||||
$enterprise->enable();
|
$enterprise->enable();
|
||||||
}
|
}
|
||||||
$enterprise->setup();
|
$enterprise->setup();
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ class enterprisePlugin extends PMPlugin
|
|||||||
|
|
||||||
public function install()
|
public function install()
|
||||||
{
|
{
|
||||||
|
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
|
|
||||||
|
$pluginDetail = $pluginRegistry->getPluginDetails("enterprise.php");
|
||||||
|
$pluginRegistry->enablePlugin($pluginDetail->sNamespace);
|
||||||
|
|
||||||
|
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function uninstall()
|
public function uninstall()
|
||||||
@@ -113,25 +119,16 @@ class enterprisePlugin extends PMPlugin
|
|||||||
|
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
$urlPart = substr(SYS_SKIN, 0, 2) == 'ux' && SYS_SKIN != 'uxs' ? 'main/login' : 'login/login';
|
|
||||||
|
|
||||||
$this->registerMenu("setup", "menuEnterprise.php");
|
$this->registerMenu("setup", "menuEnterprise.php");
|
||||||
|
////including the file inside the enterprise folder
|
||||||
//including the file inside the enterprise folder
|
|
||||||
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.pmLicenseManager.php';
|
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.pmLicenseManager.php';
|
||||||
$this->registerTrigger(PM_LOGIN, "enterpriseSystemUpdate");
|
$this->registerTrigger(PM_LOGIN, "enterpriseSystemUpdate");
|
||||||
|
$this->registerTrigger(PM_HASH_PASSWORD, 'setHashPassword');
|
||||||
$licenseManager = &pmLicenseManager::getSingleton();
|
|
||||||
$oHeadPublisher = &headPublisher::getSingleton();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enable()
|
public function enable()
|
||||||
{
|
{
|
||||||
$this->setConfiguration();
|
$this->setConfiguration();
|
||||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
|
||||||
|
|
||||||
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
|
|
||||||
|
|
||||||
require_once (PATH_CORE . 'classes/model/AddonsStore.php');
|
require_once (PATH_CORE . 'classes/model/AddonsStore.php');
|
||||||
AddonsStore::checkLicenseStore();
|
AddonsStore::checkLicenseStore();
|
||||||
@@ -348,6 +345,28 @@ class enterprisePlugin extends PMPlugin
|
|||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hashPassword ($pass, $previous=false)
|
||||||
|
{
|
||||||
|
G::LoadClass( "configuration" );
|
||||||
|
$config= new Configurations();
|
||||||
|
$typeEncrypt = $config->getConfiguration('ENTERPRISE_SETTING_ENCRYPT', '');
|
||||||
|
//$typeEncrypt = ($typeEncrypt == null) ? 'md5' : isset($typeEncrypt['current']) ? $typeEncrypt['current'] : 'md5';
|
||||||
|
$encrypt = 'md5';
|
||||||
|
if ($typeEncrypt != null) {
|
||||||
|
if (isset($typeEncrypt['current']) && $typeEncrypt['current'] != '') {
|
||||||
|
$encrypt = $typeEncrypt['current'];
|
||||||
|
error_log('hashPassword bootstrap ' . $encrypt);
|
||||||
|
}
|
||||||
|
if ($previous && isset($typeEncrypt['previous']) && $typeEncrypt['previous'] != '' ) {
|
||||||
|
$encrypt = $typeEncrypt['previous'];
|
||||||
|
error_log('hashPassword bootstrap ' . $encrypt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
eval("\$var = hash('" . $encrypt . "', '" . $pass . "');");
|
||||||
|
|
||||||
|
return $var;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
|
|||||||
@@ -40,6 +40,14 @@ try {
|
|||||||
$pwd = trim($frm['USR_PASSWORD']);
|
$pwd = trim($frm['USR_PASSWORD']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
|
||||||
|
|
||||||
|
$enterprise = new enterprisePlugin('enterprise');
|
||||||
|
|
||||||
|
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
|
||||||
|
$enterprise->enable();
|
||||||
|
}
|
||||||
|
$enterprise->setup();
|
||||||
$uid = $RBAC->VerifyLogin($usr , $pwd);
|
$uid = $RBAC->VerifyLogin($usr , $pwd);
|
||||||
$RBAC->cleanSessionFiles(72); //cleaning session files older than 72 hours
|
$RBAC->cleanSessionFiles(72); //cleaning session files older than 72 hours
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ $aUser = $oUser->load($_SESSION['USER_LOGGED']);
|
|||||||
global $RBAC;
|
global $RBAC;
|
||||||
$aData['USR_UID'] = $aUser['USR_UID'];
|
$aData['USR_UID'] = $aUser['USR_UID'];
|
||||||
$aData['USR_USERNAME'] = $aUser['USR_USERNAME'];
|
$aData['USR_USERNAME'] = $aUser['USR_USERNAME'];
|
||||||
$aData['USR_PASSWORD'] = md5($_POST['form']['USR_PASSWORD']);
|
$aData['USR_PASSWORD'] = Bootstrap::hasPassword($_POST['form']['USR_PASSWORD']);
|
||||||
$aData['USR_FIRSTNAME'] = $aUser['USR_FIRSTNAME'];
|
$aData['USR_FIRSTNAME'] = $aUser['USR_FIRSTNAME'];
|
||||||
$aData['USR_LASTNAME'] = $aUser['USR_LASTNAME'];
|
$aData['USR_LASTNAME'] = $aUser['USR_LASTNAME'];
|
||||||
$aData['USR_EMAIL'] = $aUser['USR_EMAIL'];
|
$aData['USR_EMAIL'] = $aUser['USR_EMAIL'];
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
|||||||
$newPass = G::generate_password();
|
$newPass = G::generate_password();
|
||||||
|
|
||||||
$aData['USR_UID'] = $userData['USR_UID'];
|
$aData['USR_UID'] = $userData['USR_UID'];
|
||||||
$aData['USR_PASSWORD'] = md5($newPass);
|
$aData['USR_PASSWORD'] = Bootstrap::hasPassword($newPass);
|
||||||
/* **Save after sending the mail
|
/* **Save after sending the mail
|
||||||
$rbacUser->update($aData);
|
$rbacUser->update($aData);
|
||||||
$user->update($aData);
|
$user->update($aData);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ try {
|
|||||||
$_POST['form']['USR_NEW_PASS'] = '';
|
$_POST['form']['USR_NEW_PASS'] = '';
|
||||||
}
|
}
|
||||||
if ($_POST['form']['USR_NEW_PASS'] != '') {
|
if ($_POST['form']['USR_NEW_PASS'] != '') {
|
||||||
$_POST['form']['USR_PASSWORD'] = md5( $_POST['form']['USR_NEW_PASS'] );
|
$_POST['form']['USR_PASSWORD'] = Bootstrap::hasPassword( $_POST['form']['USR_NEW_PASS'] );
|
||||||
}
|
}
|
||||||
if (! isset( $_POST['form']['USR_CITY'] )) {
|
if (! isset( $_POST['form']['USR_CITY'] )) {
|
||||||
$_POST['form']['USR_CITY'] = '';
|
$_POST['form']['USR_CITY'] = '';
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ switch ($_POST['action']) {
|
|||||||
$form['USR_NEW_PASS'] = '';
|
$form['USR_NEW_PASS'] = '';
|
||||||
}
|
}
|
||||||
if ($form['USR_NEW_PASS'] != '') {
|
if ($form['USR_NEW_PASS'] != '') {
|
||||||
$form['USR_PASSWORD'] = md5($form['USR_NEW_PASS']);
|
$form['USR_PASSWORD'] = Bootstrap::hasPassword($form['USR_NEW_PASS']);
|
||||||
}
|
}
|
||||||
if (!isset($form['USR_CITY'])) {
|
if (!isset($form['USR_CITY'])) {
|
||||||
$form['USR_CITY'] = '';
|
$form['USR_CITY'] = '';
|
||||||
@@ -214,7 +214,7 @@ switch ($_POST['action']) {
|
|||||||
*/
|
*/
|
||||||
require_once 'classes/model/UsersProperties.php';
|
require_once 'classes/model/UsersProperties.php';
|
||||||
$oUserProperty = new UsersProperties();
|
$oUserProperty = new UsersProperties();
|
||||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aData['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($aData['USR_PASSWORD'])))));
|
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aData['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(Bootstrap::hasPassword($aData['USR_PASSWORD'])))));
|
||||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = $form['USR_LOGGED_NEXT_TIME'];
|
$aUserProperty['USR_LOGGED_NEXT_TIME'] = $form['USR_LOGGED_NEXT_TIME'];
|
||||||
$oUserProperty->update($aUserProperty);
|
$oUserProperty->update($aUserProperty);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ try {
|
|||||||
$form['USR_NEW_PASS'] = '';
|
$form['USR_NEW_PASS'] = '';
|
||||||
}
|
}
|
||||||
if ($form['USR_NEW_PASS'] != '') {
|
if ($form['USR_NEW_PASS'] != '') {
|
||||||
$form['USR_PASSWORD'] = md5( $form['USR_NEW_PASS'] );
|
$form['USR_PASSWORD'] = Bootstrap::hasPassword( $form['USR_NEW_PASS'] );
|
||||||
}
|
}
|
||||||
if (! isset( $form['USR_CITY'] )) {
|
if (! isset( $form['USR_CITY'] )) {
|
||||||
$form['USR_CITY'] = '';
|
$form['USR_CITY'] = '';
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ Ext.onReady(function(){
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
fieldLabel: '<span id="pathLogFileSpan"></span> ' + _('ID_INSTALLATION_LOG'),
|
fieldLabel: '<span id="pathLogFileSpan"></span> ' + _('ID_INSTALLATION_FILE_LOG'),
|
||||||
id: 'pathLogFile',
|
id: 'pathLogFile',
|
||||||
width: 430,
|
width: 430,
|
||||||
value: path_shared + 'log' + path_sep + 'install.log',
|
value: path_shared + 'log' + path_sep + 'install.log',
|
||||||
|
|||||||
Reference in New Issue
Block a user