mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Populate 'user' property of every module instance with current user info
This commit is contained in:
parent
5f7b4837dc
commit
45e930f04c
2 changed files with 20 additions and 0 deletions
|
|
@ -1178,6 +1178,12 @@ class ModuleHandler extends Handler
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Populate default properties
|
||||
if($oModule->user === false)
|
||||
{
|
||||
$oModule->user = Context::get('logged_info');
|
||||
}
|
||||
|
||||
// Load language files for the class
|
||||
if($module !== 'module')
|
||||
|
|
|
|||
|
|
@ -26,6 +26,20 @@ class ModuleObject extends Object
|
|||
var $module_config = NULL;
|
||||
var $ajaxRequestMethod = array('XMLRPC', 'JSON');
|
||||
var $gzhandler_enable = TRUE;
|
||||
var $user = FALSE;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $error Error code
|
||||
* @param string $message Error message
|
||||
* @return void
|
||||
*/
|
||||
function __construct($error = 0, $message = 'success')
|
||||
{
|
||||
$this->user = Context::get('logged_info');
|
||||
parent::__construct($error, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* setter to set the name of module
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue