@@ -42,7 +42,7 @@ public function executeMe() {
4242 case 'AddField ' :
4343 $ p = Functions::getSGValues ($ _POST ['p ' ],array ('fieldName ' ,'fieldRegexVerification ' ,'fieldLink ' ,'fieldData ' ,'fieldType ' ,'fieldVarName ' ),'' );
4444 $ c = Functions::getSGValues ($ _POST ['c ' ],array ('fieldIsRequired ' ,'fieldShowRegistration ' ,'fieldShowMemberlist ' ),0 );
45-
45+
4646 $ errors = array ();
4747
4848 if (!in_array ($ p ['fieldType ' ],array (PROFILE_FIELD_TYPE_SELECTMULTI ,PROFILE_FIELD_TYPE_SELECTSINGLE ,PROFILE_FIELD_TYPE_TEXT ,PROFILE_FIELD_TYPE_TEXTAREA )))
@@ -52,15 +52,15 @@ public function executeMe() {
5252
5353 if (isset ($ _GET ['doit ' ])) {
5454 $ c = Functions::getSGValues ($ _POST ['c ' ],array ('fieldIsRequired ' ,'fieldShowRegistration ' ,'fieldShowMemberlist ' ),0 );
55-
55+
5656 $ this ->modules ['DB ' ]->queryParams ('SELECT "fieldID" FROM ' .TBLPFX .'profile_fields WHERE "fieldVarName"=$1 ' ,array ($ p ['fieldVarName ' ]));
5757 if (trim ($ p ['fieldVarName ' ]) == '' || $ this ->modules ['DB ' ]->numRows () > 0 ) $ errors [] = $ this ->modules ['Language ' ]->getString ('error_existing_field_variable_name ' );
5858
5959 if (count ($ errors ) == 0 ) {
6060 $ fieldData = array ();
6161 if (trim ($ p ['fieldData ' ]) != '' )
6262 $ fieldData = explode ("\n" ,Functions::str_replace ("\r" ,'' ,trim ($ p ['fieldData ' ])));
63-
63+
6464 $ this ->modules ['DB ' ]->queryParams ('
6565 INSERT INTO
6666 ' .TBLPFX .'profile_fields
@@ -85,7 +85,7 @@ public function executeMe() {
8585 $ p ['fieldLink ' ],
8686 $ p ['fieldVarName ' ]
8787 ));
88-
88+
8989 Functions::myHeader (INDEXFILE .'?action=AdminProfileFields& ' .MYSID );
9090 }
9191 }
@@ -105,11 +105,10 @@ public function executeMe() {
105105
106106 $ this ->modules ['DB ' ]->queryParams ('SELECT * FROM ' .TBLPFX .'profile_fields WHERE "fieldID"=$1 ' , array ($ fieldID ));
107107 ($ this ->modules ['DB ' ]->getAffectedRows () == 0 ) ? die ('Cannot load data: profile field ' ) : $ fieldData = $ this ->modules ['DB ' ]->fetchArray ();
108- //if($fieldData['fieldIsLocked'] == 1) die('Cannot edit field: locked field');
109-
108+
110109 $ errors = array ();
111110
112- $ p = Functions::getSGValues ($ _POST ['p ' ],array ('fieldName ' ,'fieldRegexVerification ' ,'fieldLink ' ,'fieldType ' ,'fieldVarName ' ),'' ,$ fieldData );
111+ $ p = Functions::getSGValues ($ _POST ['p ' ],array ('fieldName ' ,'fieldRegexVerification ' ,'fieldLink ' ,'fieldType ' ,'fieldVarName ' , ' fieldIsLocked ' ),'' ,$ fieldData );
113112 $ c = Functions::getSGValues ($ _POST ['c ' ],array ('fieldIsRequired ' ,'fieldShowRegistration ' ,'fieldShowMemberlist ' ),0 ,$ fieldData );
114113
115114 $ p ['fieldData ' ] = isset ($ _POST ['p ' ]['fieldData ' ]) ? $ _POST ['p ' ]['fieldData ' ] : implode ("\n" ,unserialize ($ fieldData ['fieldData ' ]));
@@ -124,12 +123,12 @@ public function executeMe() {
124123
125124 $ this ->modules ['DB ' ]->queryParams ('SELECT "fieldID" FROM ' .TBLPFX .'profile_fields WHERE "fieldVarName"=$1 AND "fieldID"<>$2 ' ,array ($ p ['fieldVarName ' ],$ fieldID ));
126125 if (trim ($ p ['fieldVarName ' ]) == '' || $ this ->modules ['DB ' ]->numRows () > 0 ) $ errors [] = $ this ->modules ['Language ' ]->getString ('error_existing_field_variable_name ' );
127-
126+
128127 if (count ($ errors ) == 0 ) {
129128 $ fieldData = array ();
130129 if (trim ($ p ['fieldData ' ]) != '' )
131130 $ fieldData = explode ("\n" ,Functions::str_replace ("\r" ,'' ,trim ($ p ['fieldData ' ])));
132-
131+
133132 $ this ->modules ['DB ' ]->queryParams ('
134133 UPDATE
135134 ' .TBLPFX .'profile_fields
@@ -157,7 +156,7 @@ public function executeMe() {
157156 $ fieldID ,
158157 $ p ['fieldVarName ' ]
159158 ));
160-
159+
161160 Functions::myHeader (INDEXFILE .'?action=AdminProfileFields& ' .MYSID );
162161 }
163162 }
0 commit comments