$jsQueue->add($mailingId, HISTORYTYPE_MAILING, 'OBJECT_CHANGE', sGuiUS(), 'mailing', NULL, NULL, $mailingId . '-mailing', 'receipients', $receipients); } } else { if ($mode == 'user') { // For users $userId = $this->params['userId']; $user = new User($userId); $currentRoles = $user->getUsergroups($userId); $addRole = true; foreach ($currentRoles as $currentRoles_item) { if ($currentRoles_item['ID'] == $roleId) { $addRole = false; } } if ($addRole) { $user->addUsergroup($roleId); $koala->queueScript('if ($K.windows[\'' . $openerRefId . '\'] && (typeof $K.windows[\'' . $openerRefId . '\'].addToSortable == \'function\')) $K.windows[\'' . $openerRefId . '\'].addToSortable( \'' . $roleId . '\', \'' . $roleName . '\', \'\', \'\' );'); } } } break; case 'savePermissions': $objectType = strtolower($this->params['objectType']); $winID = $this->params['winID']; $roleID = $this->params['roleID']; $currentSite = $this->params['currentSite']; $templateMgr = new Templates(); $embeddedCblockFolder = (int) sConfig()->getVar("CONFIG/EMBEDDED_CBLOCKFOLDER"); $systemPermissionMapping = array(1 => 'RPAGES', 2 => 'RCONTENTBLOCKS', 3 => 'RFILES', 4 => 'RTAGS', 5 => 'RUSERS', 6 => 'RUSERGROUPS', 7 => 'REXTENSIONS_PAGE', 8 => 'RIMPORT', 9 => 'REXPORT', 10 => 'RDATA', 11 => 'RSITES', 12 => 'RTEMPLATES', 13 => 'RENTRYMASKS', 14 => 'RPROPERTIES', 15 => 'RFILETYPES', 16 => 'RVIEWS', 17 => 'RCOMMENTCONFIG', 18 => 'REXTENSIONS_CBLISTVIEW', 19 => 'RMAILINGS', 20 => 'RMAILINGCONFIG', 21 => 'RCOMMENTS', 22 => 'REXTENSIONS_MAILING', 23 => 'REXTENSIONS_FILE', 24 => 'REXTENSIONS_CBLOCK', 25 => 'RUPDATER', 99 => 'RBACKEND'); // Extension Privileges $extensionMgr = new ExtensionMgr();
/** * Adds a User * * @param string $name (optional) Username * @return int|bool New User Id or FALSE in case of an error */ function add($name = 'n/a') { if (sUsergroups()->permissions->check($this->_uid, 'RUSERS')) { $name = sYDB()->escape_string(sanitize($name)); $sql = "INSERT INTO yg_user (LOGIN, PASSWORD) VALUES (?, '');"; sYDB()->Execute($sql, $name); $uid = sYDB()->Insert_ID(); if ($uid < 1) { return false; } else { $newUser = new User($uid); $newUser->addUsergroup($this->getAnonymousGroupID()); return $uid; } } else { return false; } }