Пример #1
0
         $alldata['errortext']['user_loginname'] = LAN_USER_85;
     }
 }
 // See if user just wants to delete existing photo
 if (isset($_POST['user_delete_photo'])) {
     $photo_to_delete = $udata['user_sess'];
     $changedUserData['user_sess'] = '';
 }
 if ($udata['user_image'] && !isset($changedUserData['user_image'])) {
     // $changedUserData['user_image'] = ''; // FIXME Deletes the user's image when no changes made.
     $avatar_to_delete = str_replace('-upload-', '', $udata['user_image']);
 }
 // Validate Extended User Fields.
 $changedEUFData = array();
 if (isset($_POST['ue'])) {
     $eufVals = $ue->userExtendedValidateAll($_POST['ue'], varset($_POST['hide'], TRUE));
     // Validate the extended user fields
     $changedEUFData['data'] = validatorClass::findChanges($eufVals['data'], $udata, FALSE);
 }
 // Determine whether we have an error
 $error = isset($allData['errors']) && count($allData['errors']) || isset($eufVals['errors']) && count($eufVals['errors']) || count($extraErrors);
 // Update Userclass - only if its the user changing their own data (admins can do it another way)
 if (isset($allData['data']['user_class'])) {
     unset($changedUserData['user_class']);
     // We always recalculate this
     if (FALSE === $adminEdit) {
         $e_userclass = e107::getUserClass();
         $ucList = $e_userclass->get_editable_classes(USERCLASS_LIST, TRUE);
         // List of classes which this user can edit
         if (count($ucList)) {
             $nid = $e_userclass->mergeClassLists($udata['user_class'], $ucList, $allData['data']['user_class'], TRUE);
Пример #2
0
         $allData['errortext']['user_email'] = LAN_SIGNUP_38;
         unset($allData['data']['user_email']);
     }
 }
 // Verify Custom Signup options if selected - need specific loop since the need for them is configuration-dependent
 $signup_option_title = array(LAN_USER_63, LAN_USER_71, LAN_USER_72, LAN_USER_73, LAN_USER_74);
 $signup_option_names = array('realname', 'signature', 'image', 'class', 'customtitle');
 foreach ($signup_option_names as $key => $value) {
     if ($pref['signup_option_' . $value] == 2 && !isset($alldata['data']['user_' . $value]) && !isset($alldata['errors']['user_' . $value])) {
         $alldata['errors']['user_' . $value] = ERR_GENERIC;
         $alldata['errortext']['user_' . $value] = str_replace('--SOMETHING--', $signup_option_title[$key], LAN_USER_75);
     }
 }
 // Validate Extended User Fields.
 $eufVals = array();
 $eufVals = $usere->userExtendedValidateAll(varset($_POST['ue'], array()), varset($_POST['hide'], array()), TRUE);
 // Validate the extended user fields
 // Determine whether we have an error
 $error = isset($allData['errors']) && count($allData['errors']) || isset($eufVals['errors']) && count($eufVals['errors']) || count($extraErrors);
 // All validated here - handle any errors
 if ($error) {
     $temp = array();
     if (count($extraErrors)) {
         $temp[] = implode('<br />', $extraErrors);
     }
     if (count($allData['errors'])) {
         $temp[] = validatorClass::makeErrorList($allData, 'USER_ERR_', '%n - %x - %t: %v', '<br />', $userMethods->userVettingInfo);
     }
     if (vartrue($eufVals['errors'])) {
         $temp[] = validatorClass::makeErrorList($eufVals, 'USER_ERR_', '%n - %t: %v', '<br />');
     }