27 $oAuthUser =
oxNew(
'oxuser' );
28 $oAuthUser->loadAdminUser();
29 $blisMallAdmin = $oAuthUser->oxuser__oxrights->value ==
"malladmin";
32 $sViewName = getViewName(
"oxgroups", $this->_iEditLang );
33 $oGroups =
oxNew(
"oxlist" );
34 $oGroups->init(
"oxgroups" );
35 $oGroups->selectString(
"select * from {$sViewName} order by {$sViewName}.oxtitle" );
38 $aUserRights = array();
40 $iTplLang = $oLang->getTplLanguage();
42 $iPos = count( $aUserRights );
43 $aUserRights[$iPos] =
new stdClass();
44 $aUserRights[$iPos]->name = $oLang->translateString(
"user", $iTplLang );
45 $aUserRights[$iPos]->id =
"user";
47 if ( $blisMallAdmin ) {
48 $iPos = count( $aUserRights );
49 $aUserRights[$iPos] =
new stdClass();
50 $aUserRights[$iPos]->id =
"malladmin";
51 $aUserRights[$iPos]->name = $oLang->translateString(
"Admin", $iTplLang );
56 if ( $soxId !=
"-1" && isset( $soxId ) ) {
58 $oUser =
oxNew(
"oxuser" );
59 $oUser->load( $soxId);
60 $this->_aViewData[
"edit"] = $oUser;
62 if ( !( $oUser->oxuser__oxrights->value ==
"malladmin" && !$blisMallAdmin ) ) {
64 reset( $aUserRights );
65 while ( list(, $val ) = each( $aUserRights ) ) {
66 if ( $val->id == $oUser->oxuser__oxrights->value) {
75 $oCountryList =
oxNew(
"oxCountryList" );
76 $oCountryList->loadActiveCountries( $oLang->getObjectTplLanguage() );
78 $this->_aViewData[
"countrylist"] = $oCountryList;
80 $this->_aViewData[
"allgroups"] = $oGroups;
82 $this->_aViewData[
"rights"] = $aUserRights;
84 if ($this->_sSaveError) {
89 $this->_aViewData[
'readonly'] =
true;
91 $oUserMainAjax =
oxNew(
'user_main_ajax' );
92 $this->_aViewData[
'oxajax'] = $oUserMainAjax->getColumns();
94 return "popups/user_main.tpl";
96 return "user_main.tpl";
115 if ( !isset( $aParams[
'oxuser__oxactive'] ) ) {
116 $aParams[
'oxuser__oxactive'] = 0;
119 $oUser =
oxNew(
"oxuser" );
120 if ( $soxId !=
"-1" ) {
121 $oUser->load( $soxId );
123 $aParams[
'oxuser__oxid'] = null;
128 $oUser->setPassword( $sNewPass );
132 if ( $oUser->checkIfEmailExists( $aParams[
'oxuser__oxusername'] ) ) {
133 $this->_sSaveError =
'EXCEPTION_USER_USEREXISTS';
137 $oUser->assign( $aParams );
141 $oUser->oxuser__oxbirthdate->fldtype =
'char';
149 $this->_sSaveError = $oExcp->getMessage();