Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\nexus\Hosting;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -39,7 +39,20 @@ class _Account extends \IPS\Patterns\ActiveRecord
|
||||
* @brief [ActiveRecord] ID Database Column
|
||||
*/
|
||||
public static $databaseColumnId = 'ps_id';
|
||||
|
||||
|
||||
/**
|
||||
* Account Types
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function accountTypes()
|
||||
{
|
||||
return array(
|
||||
'Cpanel' => 'IPS\nexus\Hosting\Cpanel\Account',
|
||||
'None' => 'IPS\nexus\Hosting\None\Account',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct ActiveRecord from database row
|
||||
*
|
||||
@@ -50,7 +63,8 @@ class _Account extends \IPS\Patterns\ActiveRecord
|
||||
public static function constructFromData( $data, $updateMultitonStoreIfExists = TRUE )
|
||||
{
|
||||
/* Initiate an object */
|
||||
$classname = 'IPS\\nexus\Hosting\\' . mb_ucfirst( \IPS\nexus\Hosting\Server::load( $data['account_server'] )->type ) . '\\Account';
|
||||
$availableTypes = static::accountTypes();
|
||||
$classname = $availableTypes[ mb_ucfirst( \IPS\nexus\Hosting\Server::load( $data['account_server'] )->type ) ];
|
||||
$obj = new $classname;
|
||||
$obj->_new = FALSE;
|
||||
|
||||
@@ -85,9 +99,9 @@ class _Account extends \IPS\Patterns\ActiveRecord
|
||||
{
|
||||
$chr = rand( 33, 122 );
|
||||
}
|
||||
while ( in_array( $chr, array( 38, 43, 47, 64, 92, 93, 94 ) ) );
|
||||
while ( \in_array( $chr, array( 38, 43, 47, 64, 92, 93, 94 ) ) );
|
||||
|
||||
$password .= chr( $chr );
|
||||
$password .= \chr( $chr );
|
||||
}
|
||||
$this->password = $password;
|
||||
|
||||
@@ -187,7 +201,7 @@ class _Account extends \IPS\Patterns\ActiveRecord
|
||||
*/
|
||||
public function set_exists( $exists )
|
||||
{
|
||||
$this->_data['account_exists'] = intval( $exists );
|
||||
$this->_data['account_exists'] = \intval( $exists );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user