28 $oAuthUser =
oxNew(
'oxuser');
29 $oAuthUser->loadAdminUser();
30 $blisMallAdmin = $oAuthUser->oxuser__oxrights->value ==
"malladmin";
33 $sViewName = getViewName(
"oxgroups", $this->_iEditLang);
34 $oGroups =
oxNew(
"oxlist");
35 $oGroups->init(
"oxgroups");
36 $oGroups->selectString(
"select * from {$sViewName} order by {$sViewName}.oxtitle");
39 $aUserRights = array();
41 $iTplLang = $oLang->getTplLanguage();
43 $iPos = count($aUserRights);
44 $aUserRights[$iPos] =
new stdClass();
45 $aUserRights[$iPos]->name = $oLang->translateString(
"user", $iTplLang);
46 $aUserRights[$iPos]->id =
"user";
49 $iPos = count($aUserRights);
50 $aUserRights[$iPos] =
new stdClass();
51 $aUserRights[$iPos]->id =
"malladmin";
52 $aUserRights[$iPos]->name = $oLang->translateString(
"Admin", $iTplLang);
57 if ($soxId !=
"-1" && isset($soxId)) {
59 $oUser =
oxNew(
"oxuser");
61 $this->_aViewData[
"edit"] = $oUser;
63 if (!($oUser->oxuser__oxrights->value ==
"malladmin" && !$blisMallAdmin)) {
66 while (list(, $val) = each($aUserRights)) {
67 if ($val->id == $oUser->oxuser__oxrights->value) {
76 $oCountryList =
oxNew(
"oxCountryList");
77 $oCountryList->loadActiveCountries($oLang->getObjectTplLanguage());
79 $this->_aViewData[
"countrylist"] = $oCountryList;
81 $this->_aViewData[
"allgroups"] = $oGroups;
83 $this->_aViewData[
"rights"] = $aUserRights;
85 if ($this->_sSaveError) {
90 $this->_aViewData[
'readonly'] =
true;
93 $oUserMainAjax =
oxNew(
'user_main_ajax');
94 $this->_aViewData[
'oxajax'] = $oUserMainAjax->getColumns();
96 return "popups/user_main.tpl";
99 return "user_main.tpl";
118 if (!isset($aParams[
'oxuser__oxactive'])) {
119 $aParams[
'oxuser__oxactive'] = 0;
122 $oUser =
oxNew(
"oxuser");
123 if ($soxId !=
"-1") {
124 $oUser->load($soxId);
126 $aParams[
'oxuser__oxid'] = null;
131 $oUser->setPassword($sNewPass);
135 if ($oUser->checkIfEmailExists($aParams[
'oxuser__oxusername'])) {
136 $this->_sSaveError =
'EXCEPTION_USER_USEREXISTS';
141 $oUser->assign($aParams);
145 $oUser->oxuser__oxbirthdate->fldtype =
'char';
153 $this->_sSaveError = $oExcp->getMessage();