Improved the run query page: added meaningfull examples, including "ticket of the user currently logged in", and did some cosmetics on the page (examples shown in a drawer) ; needed to add some options to the OQL (date intervals)

SVN:trunk[122]
This commit is contained in:
Romain Quetiez
2009-09-08 15:10:31 +00:00
parent f3367cd587
commit c97db0e5e3
10 changed files with 598 additions and 490 deletions

View File

@@ -50,6 +50,7 @@ abstract class UserRightsAddOnAPI
abstract public function Init(); // loads data (possible optimizations)
abstract public function CheckCredentials($sLogin, $sPassword); // returns the id of the user or false
abstract public function GetUserId($sLogin); // returns the id of the user or false
abstract public function GetContactId($sLogin); // returns the id of the "business" user or false
abstract public function GetFilter($sLogin, $sClass); // returns a filter object
abstract public function IsActionAllowed($iUserId, $sClass, $iActionCode, dbObjectSet $oInstances);
abstract public function IsStimulusAllowed($iUserId, $sClass, $sStimulusCode, dbObjectSet $oInstances);
@@ -171,6 +172,16 @@ class UserRights
}
}
public static function GetContactId($sName = '')
{
// note: returns null if the user management module is not related to the business data model
if (empty($sName))
{
$sName = self::$m_sUser;
}
return self::$m_oAddOn->GetContactId($sName);
}
public static function GetRealUser()
{
return self::$m_sRealUser;