65        $this->proxySuccess = 
false;
 
   66        $this->satisfied = 
false;
 
   69        $this->registration = 
'';
 
  163        if (!$setting->get(
'ilias_uuid', 
false)) {
 
  166            $setting->set(
'ilias_uuid', $uuid);
 
  168        $ilUuid = $setting->get(
'ilias_uuid');
 
  225            "SELECT * FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = %s AND usr_id = %s AND privacy_ident = %s",
 
  226            array(
'integer', 
'integer', 
'integer'),
 
  230        while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  237        $this->
setObjId((
int) $dbRow[
'obj_id']);
 
  238        $this->
setUsrId((
int) $dbRow[
'usr_id']);
 
  251            $DIC->database()->replace(
 
  254                    'obj_id' => array(
'integer', (
int) $this->
getObjId()),
 
  255                    'usr_id' => array(
'integer', (
int) $this->
getUsrId()),
 
  261                    'usr_ident' => array(
'text', $this->
getUsrIdent()),
 
  263                    'satisfied' => array(
'integer', (
int) $this->
getSatisfied())
 
  274            "SELECT * FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = %s AND usr_id = %s",
 
  275            array(
'integer', 
'integer'),
 
  278        $cmixUsers = array();
 
  279        while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  280            $cmixUser = 
new self();
 
  281            $cmixUser->assignFromDbRow($row);
 
  282            $cmixUsers[] = $cmixUser;
 
  292            "SELECT * FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = %s AND usr_ident = %s",
 
  293            array(
'integer', 
'text'),
 
  297        $cmixUser = 
new self();
 
  299        while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  300            $cmixUser->assignFromDbRow($row);
 
  315        $DIC->database()->update(
 
  318                'proxy_success' => array(
'integer', 1)
 
  321                'obj_id' => array(
'integer', (
int) 
$objId),
 
  322                'usr_id' => array(
'integer', (
int) 
$usrId),
 
  338        switch ($userIdentMode) {
 
  361                $tmpHash = hash(
"sha256", 
'' . $user->
getId() . $user->
getCreateDate()) . 
'@' . str_replace(
'www.', 
'', 
$_SERVER[
'HTTP_HOST']);
 
  362                if (strlen($tmpHash) > 80) {
 
  363                    $tmpHash = substr($tmpHash, strlen($tmpHash) - 80);
 
  386        switch ($userIdentMode) {
 
  389                return $user->
getId();
 
  405                $tmpHost = 
'@' . str_replace(
'www.', 
'', 
$_SERVER[
'HTTP_HOST']);
 
  406                if (strlen($tmpHash . $tmpHost) > 80) {
 
  407                    $tmpHash = substr($tmpHash, strlen($tmpHash) - (80 - strlen($tmpHost)));
 
  417                return 'realemail' . $user->
getId();
 
  430        return "{$mbox}@{$domain}.ilias";
 
  440        switch ($userNameMode) {
 
  471            "SELECT * FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = %s",
 
  478        if ($asUsrId === 
false) {
 
  479            while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  480                $cmixUser = 
new self();
 
  481                $cmixUser->assignFromDbRow($row);
 
  483                $users[] = $cmixUser;
 
  486            while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  487                $users[] = $row[
'usr_id'];
 
  503            "SELECT usr_ident FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = %s AND usr_id = %s",
 
  504            array(
'integer',
'integer'),
 
  509        while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  510            $usrIdents[] = $row[
'usr_ident'];
 
  522        $query = 
"DELETE FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = " . 
$DIC->database()->quote(
$objId, 
'integer');
 
  523        if (count($users) == 0) {
 
  526            $DIC->database()->manipulateF(
 
  527                $query . 
" AND usr_id = %s",
 
  539            $query = 
"SELECT count(*) cnt FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = %s AND usr_id = %s";
 
  542                array(
'integer', 
'integer'),
 
  546            $query = 
"SELECT count(*) cnt FROM " . self::DB_TABLE_NAME . 
" WHERE obj_id = %s AND usr_id = %s AND privacy_ident = %s";
 
  549                array(
'integer', 
'integer', 
'integer'),
 
  554        while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  555            return (
bool) $row[
'cnt'];
 
  566                        SELECT DISTINCT cu.obj_id 
  567                        FROM " . self::DB_TABLE_NAME . 
" cu 
  568                        INNER JOIN object_data od 
  569                        ON od.obj_id = cu.obj_id 
  571                        WHERE cu.proxy_success != %s 
  574        $res = 
$DIC->database()->queryF(
$query, array(
'integer'), array(1));
 
  578        while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  579            $objects[] = $row[
'obj_id'];
 
  589        $IN_objIds = 
$DIC->database()->in(
'obj_id', $objectIds, 
false, 
'integer');
 
  591        $query = 
"UPDATE " . self::DB_TABLE_NAME . 
" SET fetched_until = %s WHERE $IN_objIds";
 
  603                                INNER JOIN object_data od 
  604                                ON od.obj_id = cu.obj_id 
  605                                AND od.type = {$DIC->database()->quote($type, 'text')} 
  611                        FROM " . self::DB_TABLE_NAME . 
" cu 
  613                        WHERE cu.usr_id = {$DIC->database()->quote($usrId, 'integer')} 
  620        while ($row = 
$DIC->database()->fetchAssoc(
$res)) {
 
  621            $objIds[] = $row[
'obj_id'];
 
  663        $multiplier = floor($length / 8) * 2;
 
  664        $uid = str_shuffle(str_repeat(uniqid(), $multiplier));
 
  667            $ident = bin2hex(random_bytes($length));
 
  668        } 
catch (Exception 
$e) {
 
  672        $start = rand(0, strlen($ident) - $length - 1);
 
  673        return substr($ident, $start, $length);
 
  680        $query = 
"SELECT usr_ident FROM " . self::DB_TABLE_NAME . 
" WHERE " . 
$DIC->database()->like(
'usr_ident', 
'text', $id . 
'@%');
 
  690        return (
new \Ramsey\Uuid\UuidFactory())->uuid3(self::getIliasUuid(), 
$objId . 
'-' . 
$usrId);
 
  695        return (
new \Ramsey\Uuid\UuidFactory())->uuid3(self::getIliasUuid(), $obj->
getRefId() . 
'-' . $user->
getId());
 
  700        return (
new \Ramsey\Uuid\UuidFactory())->uuid3(self::getIliasUuid(), $authToken->
getObjId() . 
'-' . $authToken->
getUsrId());
 
  705        return (
new \Ramsey\Uuid\UuidFactory())->uuid3(self::getIliasUuid(), $authToken->
getRefId() . 
'-' . $authToken->
getUsrId());
 
An exception for terminatinating execution or to throw for unit testing.
setRegistration(string $registration)
static saveProxySuccess($objId, $usrId, $privacyIdent)
static deleteUsersForObject(int $objId, ?array $users=[])
static buildPseudoEmail($mbox, $domain)
static updateFetchedUntilForObjects(ilCmiXapiDateTime $fetchedUntil, $objectIds)
setProxySuccess($proxySuccess)
static getUserObjectUniqueId($length=32)
static getUUID($length=32)
static getInstancesByObjectIdAndUsrId($objId, $usrId)
static userObjectUniqueIdExists($id)
static getIdent($userIdentMode, ilObjUser $user)
setPrivacyIdent($privacyIdent)
static getName($userNameMode, ilObjUser $user)
static getUsersForObject($objId, $asUsrId=false)
static lookupObjectIds($usrId, $type='')
static getUserIdents($objId, $usrId)
static getCMI5RegistrationFromAuthToken(ilCmiXapiAuthToken $authToken)
__construct($objId=null, $usrId=null, $privacyIdent=null)
static getInstanceByObjectIdAndUsrIdent($objId, $usrIdent)
setFetchUntil(ilCmiXapiDateTime $fetchUntil)
static generateCMI5Registration($objId, $usrId)
static getIdentAsId($userIdentMode, ilObjUser $user)
static exists($objId, $usrId, $privacyIdent=999)
static getRegistrationFromAuthToken(ilCmiXapiAuthToken $authToken)
setUsrIdent(string $usrIdent)
static generateRegistration(ilObjCmiXapi $obj, ilObjUser $user)
static getCmixObjectsHavingUsersMissingProxySuccess()
get($a_format, $a_format_str='', $a_tz='')
get formatted date
const PRIVACY_NAME_FULLNAME
const PRIVACY_NAME_FIRSTNAME
const PRIVACY_IDENT_IL_UUID_USER_ID
const PRIVACY_IDENT_IL_UUID_RANDOM
const PRIVACY_IDENT_IL_UUID_LOGIN
const PRIVACY_IDENT_REAL_EMAIL
const PRIVACY_IDENT_IL_UUID_SHA256
const PRIVACY_IDENT_IL_UUID_EXT_ACCOUNT
const PRIVACY_NAME_LASTNAME
const PRIVACY_IDENT_IL_UUID_SHA256URL
getLastname()
get lastname @access public
getUTitle()
get user title (note: don't mix up this method with getTitle() that is derived from ilObject and gets...
getEmail()
get email address @access public
getFirstname()
get firstname @access public
getLogin()
get login / username @access public
getFullname($a_max_strlen=0)
get fullname @access public
static _isAnonymous($usr_id)
getExternalAccount()
get external account
getRefId()
get reference id @access public
getId()
get object id @access public
getCreateDate()
get create date @access public
static is_email($a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
foreach($_POST as $key=> $value) $res