NAVIGATION
This shows you the differences between two versions of the page.
|
deutsch:module:archiv [2009/11/15 20:21] Jürgen Günther |
deutsch:module:archiv [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{indexmenu_n>1000}} | {{indexmenu_n>1000}} | ||
| - | Sejr einfacher automatische Nutzerverwaltung : | ||
| - | <ode> | ||
| - | <?php | ||
| - | // first check what to do | ||
| - | if(_getFeUserLoginStatus() && strpos($content['all'], '{FE_USER_MANAGE}')) { | ||
| - | |||
| - | $fe_action = '{FE_USER_MANAGE}'; | ||
| - | |||
| - | if( $_SESSION[ $_loginData['session_key'].'_userdata']['source'] == 'BACKEND' ) { | ||
| - | |||
| - | $fe_action = false; | ||
| - | } | ||
| - | |||
| - | |||
| - | } elseif(strpos($content['all'], '{FE_USER_REGISTER}')) { | ||
| - | |||
| - | $fe_action = '{FE_USER_REGISTER}'; | ||
| - | |||
| - | } else { | ||
| - | |||
| - | $fe_action = false; | ||
| - | |||
| - | } | ||
| - | |||
| - | |||
| - | // fe user register | ||
| - | if($fe_action) { | ||
| - | |||
| - | $udata = array( | ||
| - | 'user_login' => '', | ||
| - | 'user_password' => '', | ||
| - | |||
| - | 'user_company' => '', | ||
| - | 'user_title' => '', | ||
| - | 'user_name' => '', | ||
| - | 'user_firstname' => '', | ||
| - | 'user_street' => '', | ||
| - | 'user_zip' => '', | ||
| - | 'user_city' => '', | ||
| - | 'user_tel' => '', | ||
| - | 'user_email' => '', | ||
| - | |||
| - | |||
| - | ); | ||
| - | |||
| - | |||
| - | if($content['cat_id'] == 0) { | ||
| - | if($aktion[1]) { | ||
| - | $_uri_alias = 'aid='.$aktion[1]; | ||
| - | } elseif($content['struct'][0]['acat_alias']) { | ||
| - | $_uri_alias = $content['struct'][0]['acat_alias']; | ||
| - | } else { | ||
| - | $_uri_alias = 'id='.$content['cat_id']; | ||
| - | } | ||
| - | } else { | ||
| - | $_uri_alias = ''; | ||
| - | } | ||
| - | |||
| - | switch($fe_action) { | ||
| - | |||
| - | case '{FE_USER_MANAGE}': $_uri = rel_url( array('profile_manage'=>'edit'), array('profile_register', 'rofile_reminder'), $_uri_alias ); | ||
| - | |||
| - | // at the moment it is only possible to edit user data of "real" FRONTEND users | ||
| - | // all BACKEND users should login to backend and edit their data there | ||
| - | $sql = 'SELECT * FROM '.DB_PREPEND.'phpwcms_userdetail WHERE '; | ||
| - | $sql .= 'detail_id=' . intval($_SESSION[ $_loginData['session_key'].'_userdata']['id']).' LIMIT 1'; | ||
| - | $result = _dbQuery($sql); | ||
| - | if(isset($result[0])) { | ||
| - | $udata = unserialize($result[0]['detail_notes']); | ||
| - | } | ||
| - | $udata['user_password'] = ''; | ||
| - | |||
| - | break; | ||
| - | |||
| - | case '{FE_USER_REGISTER}': $_uri = rel_url( array('profile_register'=>'create'), array('profile_manage', 'rofile_reminder'), $_uri_alias ); | ||
| - | |||
| - | |||
| - | break; | ||
| - | |||
| - | } | ||
| - | |||
| - | |||
| - | $uerror = array( | ||
| - | |||
| - | 'status' => false, | ||
| - | |||
| - | 'user_login' => '', | ||
| - | 'user_password' => '', | ||
| - | |||
| - | 'user_company' => '', | ||
| - | 'user_title' => '', | ||
| - | 'user_name' => '', | ||
| - | 'user_firstname' => '', | ||
| - | 'user_street' => '', | ||
| - | 'user_zip' => '', | ||
| - | 'user_city' => '', | ||
| - | 'user_tel' => '', | ||
| - | 'user_email' => '' | ||
| - | |||
| - | ); | ||
| - | |||
| - | $user_title = array('Herr', 'Frau', ''); | ||
| - | |||
| - | if(isset($_POST['user_login'])) { | ||
| - | |||
| - | $fe_csv = array(); | ||
| - | |||
| - | $udata['user_login'] = clean_slweg($_POST['user_login']); | ||
| - | $udata['user_password'] = slweg($_POST['user_password']); | ||
| - | $udata['user_password2'] = slweg($_POST['user_password2']); | ||
| - | |||
| - | $udata['user_company'] = clean_slweg($_POST['user_company']); | ||
| - | $udata['user_title'] = clean_slweg($_POST['user_title']); | ||
| - | $udata['user_name'] = clean_slweg($_POST['user_name']); | ||
| - | $udata['user_firstname'] = clean_slweg($_POST['user_firstname']); | ||
| - | $udata['user_street'] = clean_slweg($_POST['user_street']); | ||
| - | $udata['user_zip'] = clean_slweg($_POST['user_zip']); | ||
| - | $udata['user_city'] = clean_slweg($_POST['user_city']); | ||
| - | $udata['user_tel'] = preg_replace('/[^0-9\+\-\(\) ]/', '', clean_slweg($_POST['user_tel']) ); | ||
| - | $udata['user_email'] = clean_slweg($_POST['user_email']); | ||
| - | |||
| - | $fe_csv['login'] = $udata['user_login']; | ||
| - | $fe_csv['company'] = $udata['user_company']; | ||
| - | $fe_csv['title'] = $udata['user_title']; | ||
| - | $fe_csv['name'] = $udata['user_name']; | ||
| - | $fe_csv['firstname'] = $udata['user_firstname']; | ||
| - | $fe_csv['street'] = $udata['user_street']; | ||
| - | $fe_csv['zip'] = $udata['user_zip']; | ||
| - | $fe_csv['city'] = $udata['user_city']; | ||
| - | $fe_csv['tel'] = $udata['user_tel']; | ||
| - | $fe_csv['email'] = $udata['user_email']; | ||
| - | |||
| - | if($fe_action == '{FE_USER_REGISTER}') { | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | $sql = 'SELECT COUNT(*) FROM '.DB_PREPEND."phpwcms_userdetail WHERE "; | ||
| - | $sql .= "detail_login LIKE '" . aporeplace($udata['user_login'])."'"; | ||
| - | |||
| - | if( empty($udata['user_login']) ) { | ||
| - | $uerror['user_login'] = 'Login muss ausgefüllt werden'; | ||
| - | } elseif( strlen($udata['user_login']) < 4 ) { | ||
| - | $uerror['user_login'] = 'Login muss mindestens 4 Zeichen lang sein'; | ||
| - | } elseif( _dbCount( $sql ) ) { | ||
| - | $uerror['user_login'] = 'Dieser Login ist bereits vergeben'; | ||
| - | } | ||
| - | |||
| - | if( empty($udata['user_password']) ) { | ||
| - | $uerror['user_password'] = 'Passwort muss ausgefüllt werden'; | ||
| - | } elseif( strlen($udata['user_password']) < 4 ) { | ||
| - | $uerror['user_password'] = 'Passwort muss mindestens 4 Zeichen lang sein'; | ||
| - | } elseif( $udata['user_password'] !== $udata['user_password2'] ) { | ||
| - | $uerror['user_password'] = 'Passwort und Passwort Wiederholung sind nicht identisch'; | ||
| - | } | ||
| - | |||
| - | |||
| - | if(isset($_POST['user_profile_3']) && is_array($_POST['user_profile_3'])) { | ||
| - | foreach($_POST['user_profile_3'] as $key => $value) { | ||
| - | $udata['user_profile_3'][$key] = clean_slweg($value); | ||
| - | } | ||
| - | } | ||
| - | |||
| - | if(isset($_POST['user_profile_4']) && is_array($_POST['user_profile_4'])) { | ||
| - | foreach($_POST['user_profile_4'] as $key => $value) { | ||
| - | $udata['user_profile_4'][$key] = clean_slweg($value); | ||
| - | } | ||
| - | } | ||
| - | |||
| - | if(isset($_POST['user_profile_7']) && is_array($_POST['user_profile_7'])) { | ||
| - | foreach($_POST['user_profile_7'] as $key => $value) { | ||
| - | $udata['user_profile_7'][$key] = intval($value); | ||
| - | } | ||
| - | } | ||
| - | |||
| - | if(isset($_POST['user_profile_12']) && is_array($_POST['user_profile_12'])) { | ||
| - | foreach($_POST['user_profile_12'] as $key => $value) { | ||
| - | $udata['user_profile_12'][$key] = clean_slweg($value); | ||
| - | } | ||
| - | } | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | } else { | ||
| - | |||
| - | $udata['user_login'] = $_SESSION[ $_loginData['session_key'].'_userdata']['login']; | ||
| - | |||
| - | if( !empty($udata['user_password']) && strlen($udata['user_password']) < 4 ) { | ||
| - | $uerror['user_password'] = 'Passwort muss mindestens 4 Zeichen lang sein'; | ||
| - | } elseif( $udata['user_password'] !== $udata['user_password2'] ) { | ||
| - | $uerror['user_password'] = 'Passwort und Passwort Wiederholung sind nicht identisch'; | ||
| - | } | ||
| - | |||
| - | $udata['user_profile_7'][3] = empty($_POST['user_profile_7'][3]) ? 0 : 1; | ||
| - | |||
| - | } | ||
| - | |||
| - | $sql = 'SELECT COUNT(*) FROM '.DB_PREPEND."phpwcms_userdetail WHERE "; | ||
| - | $sql .= "detail_login != '" . aporeplace($udata['user_login']) . "' AND "; | ||
| - | $sql .= "detail_email = '" . aporeplace(strtolower($udata['user_email']))."'"; | ||
| - | |||
| - | if( empty($udata['user_email']) ) { | ||
| - | $uerror['user_email'] = 'E-Mail muss ausgefüllt werden'; | ||
| - | } elseif( !is_valid_email($udata['user_email']) ) { | ||
| - | $uerror['user_email'] = 'E-Mail muss valide sein'; | ||
| - | } elseif( _dbCount( $sql ) ) { | ||
| - | $uerror['user_email'] = 'E-Mail bereits registriert'; | ||
| - | } | ||
| - | |||
| - | if( empty($udata['user_tel']) ) { | ||
| - | $uerror['user_tel'] = 'Telefon muss ausgefüllt werden'; | ||
| - | } elseif( preg_match('/[^0-9\+\-\(\) ]/', $udata['user_tel']) ) { | ||
| - | $uerror['user_tel'] = 'Telefonnummer darf nur Zahlen, Leerzeichen, Klammern, + oder - enthalten'; | ||
| - | } | ||
| - | |||
| - | if( empty($udata['user_name']) ) { | ||
| - | $uerror['user_name'] = 'Name muss ausgefüllt werden'; | ||
| - | } | ||
| - | |||
| - | if( empty($udata['user_firstname']) ) { | ||
| - | $uerror['user_firstname'] = 'Vorname muss ausgefüllt werden'; | ||
| - | } | ||
| - | if( empty($udata['user_firstname']) ) { | ||
| - | $uerror['user_firstname'] = 'Vorname muss ausgefüllt werden'; | ||
| - | } | ||
| - | if( empty($udata['user_company']) ) { | ||
| - | $uerror['user_company'] = 'Firma muss ausgefüllt werden'; | ||
| - | } | ||
| - | if( empty($udata['user_street']) ) { | ||
| - | $uerror['user_street'] = 'Straße muss ausgefüllt werden'; | ||
| - | } | ||
| - | if( empty($udata['user_zip']) || empty($udata['user_city']) ) { | ||
| - | $uerror['user_zip'] = 'PLZ und Ort müssen ausgefüllt werden'; | ||
| - | } | ||
| - | |||
| - | |||
| - | } | ||
| - | |||
| - | $fe_reg = array(); | ||
| - | |||
| - | if($fe_action == '{FE_USER_REGISTER}') { | ||
| - | |||
| - | $fe_reg[] = '<p>Text</p>'; | ||
| - | |||
| - | } else { | ||
| - | |||
| - | $fe_reg[] = '<p>Text</p>'; | ||
| - | |||
| - | } | ||
| - | |||
| - | $fe_reg[] = '<form action="' .$_uri. '" method="post">'; | ||
| - | |||
| - | // Fieldset 1 -> login basics | ||
| - | $fe_reg[] = '<fieldset>'; | ||
| - | $fe_reg[] = '<legend> Login Data </legend>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_login'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_login">Login</label>'; | ||
| - | if($fe_action == '{FE_USER_REGISTER}') { | ||
| - | $fe_reg[] = '<input type="text" name="user_login" id="user_login" value="' .html_specialchars($udata['user_login']). '" class="textfield" maxlength="200" size="30" />'; | ||
| - | } else { | ||
| - | $fe_reg[] = '<strong>' .html_specialchars($udata['user_login']). '</strong>'; | ||
| - | $fe_reg[] = '<input type="hidden" name="user_login" value="' .html_specialchars($udata['user_login']). '" />'; | ||
| - | } | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_password'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_password">Password</label>'; | ||
| - | $fe_reg[] = '<input type="password" name="user_password" id="user_password" class="textfield" maxlength="20" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_password2">Password repeat</label>'; | ||
| - | $fe_reg[] = '<input type="password" name="user_password2" id="user_password2" class="textfield" maxlength="20" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | $fe_reg[] = '</fieldset>'; | ||
| - | |||
| - | $fe_reg[] = '<fieldset>'; | ||
| - | $fe_reg[] = '<legend> Adress information </legend>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_company'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_company">Company</label>'; | ||
| - | $fe_reg[] = '<input type="text" name="user_company" id="user_company" value="' .html_specialchars($udata['user_company']). '" class="textfield" maxlength="200" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos">Title</label>'; | ||
| - | foreach($user_title as $key => $value) { | ||
| - | $fe_reg['title'.$key] = '<input type="radio" name="user_title" id="title'.$key.'" value="' ; | ||
| - | $fe_reg['title'.$key] .= html_specialchars($value) . '"'.is_checked($value, $udata['user_title'], 1, 0).' />'; | ||
| - | if($value) { | ||
| - | $fe_reg['title'.$key] .= '<label class="inline" for="title'.$key.'">' . html_specialchars($value) . '</label>'; | ||
| - | } else { | ||
| - | $fe_reg['title'.$key] .= '<label class="inline" for="title'.$key.'">no title</label>'; | ||
| - | } | ||
| - | } | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_firstname'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_firstname">First name</label>'; | ||
| - | $fe_reg[] = '<input type="text" name="user_firstname" id="user_firstname" value="' .html_specialchars($udata['user_firstname']). '" class="textfield" maxlength="200" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_name'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_name">Name</label>'; | ||
| - | $fe_reg[] = '<input type="text" name="user_name" id="user_name" value="' .html_specialchars($udata['user_name']). '" class="textfield" maxlength="200" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_street'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_street">Street</label>'; | ||
| - | $fe_reg[] = '<input type="text" name="user_street" id="user_street" value="' .html_specialchars($udata['user_street']). '" class="textfield" maxlength="200" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_zip'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos">Post code, city</label>'; | ||
| - | $fe_reg[] = '<input type="text" name="user_zip" id="user_zip" value="' .html_specialchars($udata['user_zip']). '" class="textfield_zip" maxlength="5" size="5" />'; | ||
| - | $fe_reg[] = '<input type="text" name="user_city" id="user_city" value="' .html_specialchars($udata['user_city']). '" class="textfield_city" maxlength="200" size="25" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = '</fieldset>'; | ||
| - | |||
| - | $fe_reg[] = '<fieldset>'; | ||
| - | $fe_reg[] = '<legend> Kommunikation </legend>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_tel'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_tel">Phone</label>'; | ||
| - | $fe_reg[] = '<input type="text" name="user_tel" id="user_tel" value="' .html_specialchars($udata['user_tel']). '" class="textfield" maxlength="200" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = is_uerror('user_email'); | ||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="labelpos" for="user_email">Email</label>'; | ||
| - | $fe_reg[] = '<input type="text" name="user_email" id="user_email" value="' .html_specialchars($udata['user_email']). '" class="textfield" maxlength="200" size="30" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | $fe_reg[] = '</fieldset>'; | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | $fe_reg[] = '<fieldset class="profile_info">'; | ||
| - | $fe_reg[] = '<legend> Informationen </legend>'; | ||
| - | |||
| - | if($fe_action == '{FE_USER_REGISTER}') { | ||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="inline">' . | ||
| - | '<input type="checkbox" name="user_profile_7[0]" value="1"'.is_checked(1, empty($udata['user_profile_7'][0]) ? 0 : 1 , 1, 0).' />' . | ||
| - | 'Text.</label>'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="inline">' . | ||
| - | '<input type="checkbox" name="user_profile_7[1]" value="1"'.is_checked(1, empty($udata['user_profile_7'][1]) ? 0 : 1 , 1, 0).' />' . | ||
| - | 'Text.</label>'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="inline">' . | ||
| - | '<input type="checkbox" name="user_profile_7[2]" value="1"'.is_checked(1, empty($udata['user_profile_7'][2]) ? 0 : 1 , 1, 0).' />' . | ||
| - | 'Ich habe noch Fragen zu</label> '. | ||
| - | '<input type="text" name="user_profile_8" value="' . html_specialchars($udata['user_profile_8']) . '" size="15" maxlength="200" class="textfield inline" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | } | ||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="inline">' . | ||
| - | '<input type="checkbox" name="user_profile_7[3]" value="1"'.is_checked(1, empty($udata['user_profile_7'][3]) ? 0 : 1 , 1, 0).' />' . | ||
| - | 'Text.</label>'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | if($fe_action == '{FE_USER_REGISTER}') { | ||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<label class="inline">' . | ||
| - | '<input type="checkbox" name="user_profile_7[4]" value="1"'.is_checked(1, empty($udata['user_profile_7'][4]) ? 0 : 1 , 1, 0).' />' . | ||
| - | '<strong>I want a login.</strong></label>'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | } | ||
| - | |||
| - | $fe_reg[] = '</fieldset>'; | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | $fe_reg[] = '<p>'; | ||
| - | $fe_reg[] = '<input type="submit" value="Senden" class="button" />'; | ||
| - | $fe_reg[] = '</p>'; | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | $fe_reg[] = '</form>'; | ||
| - | |||
| - | $fe_reg = implode(LF, $fe_reg); | ||
| - | |||
| - | |||
| - | if(isset($_POST['user_login']) && $fe_action == '{FE_USER_REGISTER}') { | ||
| - | if($uerror['status']) { | ||
| - | |||
| - | $fe_reg = '<p class="error">Es sind Fehler bei der Verarbeitung des Formulars aufgetreten. Bitte prüfen Sie Ihre Angaben.</p>' . LF . $fe_reg; | ||
| - | |||
| - | } else { | ||
| - | |||
| - | $profile_data = $udata; | ||
| - | unset($profile_data['user_password'], $profile_data['user_password2']); | ||
| - | |||
| - | $sql = 'INSERT INTO '.DB_PREPEND.'phpwcms_userdetail ('; | ||
| - | $sql .= 'detail_title, detail_firstname, detail_lastname, detail_company, detail_street, detail_city, detail_zip, '; | ||
| - | $sql .= 'detail_fon, detail_notes, detail_aktiv, detail_newsletter, detail_varchar1, detail_email, detail_login, detail_password) VALUES ('; | ||
| - | $sql .= "'" . aporeplace($udata['user_title']) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_firstname']) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_name']) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_company']) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_street']) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_city']) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_zip']) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_tel']) . "', "; | ||
| - | $sql .= "'" . aporeplace(serialize($profile_data)) . "', "; | ||
| - | $sql .= "'1', "; | ||
| - | $sql .= "'" . ( empty($udata['user_profile_7'][3]) ? '' : 1 ) . "', "; | ||
| - | $sql .= "'fereg', "; | ||
| - | $sql .= "'" . aporeplace(strtolower($udata['user_email'])) . "', "; | ||
| - | $sql .= "'" . aporeplace($udata['user_login']) . "', "; | ||
| - | $sql .= "'" . aporeplace(md5($udata['user_password'])) . "')"; | ||
| - | |||
| - | $queryResult = _dbQuery($sql, 'INSERT'); | ||
| - | if(!empty($queryResult['INSERT_ID'])) { | ||
| - | $fe_reg = '<p class="success">Vielen Dank '.html_specialchars($udata['user_firstname'].' '.$udata['user_name']).'! Ihre Registrierungsanfrage wurden erfolgreich übertragen.</p>'; | ||
| - | $fe_reg .= '<p>Ihnen wird in wenigen Augenblicken eine Bestätigung an die E-Mail <b>'.html_specialchars($udata['user_email']).'</b> zugesendet.</p>'; | ||
| - | |||
| - | $fe_text = 'Hallo '.trim($udata['user_title'] . ' ' . trim( $udata['user_firstname'].' '.$udata['user_name']) ) . LF . LF; | ||
| - | $fe_text .= 'Ihre Registrierung haben wir erhalten.' . LF; | ||
| - | $fe_text .= 'Wir prüfen Ihre Daten und melden uns umgehend bei Ihnen.' . LF . LF; | ||
| - | |||
| - | if(empty($udata['user_profile_7'][4])) { | ||
| - | $fe_text .= 'Sie möchten keinen Zugriff auf unser Partnerbackend. ' .LF . 'Allerdings haben wir folgende Zugangsdaten für Sie hinterlegt:' . LF; | ||
| - | } else { | ||
| - | $fe_text .= 'Sie möchten Zugriff auf unser Partnerbackend. ' .LF . 'Folgende Zugangsdaten sind von Ihnen gesendet worden:' . LF; | ||
| - | } | ||
| - | $fe_text .= ' Login: ' . $udata['user_login'] . LF; | ||
| - | $fe_text .= ' Passwort: ' . $udata['user_password'] . LF . LF; | ||
| - | $fe_text .= 'Ihr Passwort ist nicht reproduizierbar verschlüsselt in unserem System abgelegt worden.' . LF . LF . LF; | ||
| - | $fe_text .= 'Mit besten Grüßen' . LF; | ||
| - | $fe_text .= 'phpwcms, Oliver' . LF; | ||
| - | |||
| - | $fe_text1 = 'Neue Benutzerregistrierung' . LF; | ||
| - | $fe_text1 .= '--------------------------' . LF . LF; | ||
| - | |||
| - | $fe_text1 .= 'Die Benutzerdaten können im Backend eingesehen werden.' . LF; | ||
| - | |||
| - | if(!empty($udata['user_profile_7'][4])) { | ||
| - | $fe_text1 .= 'Der Benutzer wünscht die Freischaltung für den Partnerbereich!' .LF; | ||
| - | $fe_text1 .= ' Login: ' . $udata['user_login'] . LF; | ||
| - | } | ||
| - | |||
| - | $fe_text1 .= LF; | ||
| - | $fe_text1 .= 'Benutzerangaben:' . LF; | ||
| - | $fe_text1 .= '================' . LF . LF; | ||
| - | |||
| - | $fe_text1 .= 'Firma: ' . $udata['user_company'] . LF; | ||
| - | $fe_text1 .= 'Anrede: ' . $udata['user_title'] . LF; | ||
| - | $fe_text1 .= 'Vorname: ' . $udata['user_firstname'] . LF; | ||
| - | $fe_text1 .= 'Name: ' . $udata['user_name'] . LF; | ||
| - | $fe_text1 .= 'Straße: ' . $udata['user_street'] . LF; | ||
| - | $fe_text1 .= 'PLZ: ' . $udata['user_zip'] . LF; | ||
| - | $fe_text1 .= 'Ort: ' . $udata['user_city'] . LF; | ||
| - | $fe_text1 .= 'Telefon: ' . $udata['user_tel'] . LF; | ||
| - | $fe_text1 .= 'E-Mail: ' . $udata['user_email'] . LF; | ||
| - | |||
| - | $fe_text1 .= LF . '-----------------------------------------------------------' . LF; | ||
| - | $fe_text1 .= 'IP: '. getRemoteIP(); | ||
| - | |||
| - | $fe_csv_attach = implode(';', array_keys($fe_csv) ); | ||
| - | $fe_csv_attach .= LF; | ||
| - | $fe_csv_attach .= implode(';', $fe_csv ); | ||
| - | |||
| - | $fe_csv = array(); | ||
| - | |||
| - | $fe_csv['filename'] = date('Y-m-d_H-i-s') . '_' . preg_replace('/[^a-zA-Z0-9\-_]/', '', $udata['user_login']).'.csv'; | ||
| - | $fe_csv['mime'] = 'text/csv'; | ||
| - | $fe_csv['data'] = $fe_csv_attach; | ||
| - | |||
| - | sendEmail(array( | ||
| - | 'recipient' => strtolower($udata['user_email']), | ||
| - | 'toName' => trim($udata['user_firstname'].' '.$udata['user_name']), | ||
| - | 'subject' => 'phpwcms Registration', | ||
| - | 'text' => $fe_text, | ||
| - | 'from' => 'oliver@phpwcms.de', | ||
| - | 'fromName' => 'phpwcms', | ||
| - | 'sender' => 'oliver@phpwcms.de' )); | ||
| - | |||
| - | sendEmail(array( | ||
| - | 'recipient' => 'slackero+phpwcms-registration@gmail.com', | ||
| - | 'subject' => 'New registration', | ||
| - | 'text' => $fe_text1, | ||
| - | 'from' => strtolower($udata['user_email']), | ||
| - | 'fromName' => trim($udata['user_firstname'].' '.$udata['user_name']), | ||
| - | 'sender' => strtolower($udata['user_email']), | ||
| - | 'stringAttach' => array($fe_csv) )); | ||
| - | |||
| - | |||
| - | } else { | ||
| - | $fe_reg = '<p class="error">Beim Speichern Ihrer Daten ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut oder wenden Sie sich an den Webmaster.</p>' . LF . $fe_reg; | ||
| - | } | ||
| - | } | ||
| - | } | ||
| - | |||
| - | |||
| - | |||
| - | if(isset($_POST['user_login']) && $fe_action == '{FE_USER_MANAGE}') { | ||
| - | |||
| - | if($uerror['status']) { | ||
| - | |||
| - | $fe_reg = '<p class="error">Es sind Fehler bei der Verarbeitung des Formulars aufgetreten. Bitte prüfen Sie Ihre Angaben.</p>' . LF . $fe_reg; | ||
| - | |||
| - | } else { | ||
| - | |||
| - | $profile_data = $udata; | ||
| - | unset($profile_data['user_password'], $profile_data['user_password2']); | ||
| - | |||
| - | $sql = 'UPDATE '.DB_PREPEND.'phpwcms_userdetail SET '; | ||
| - | $sql .= "detail_title = '".aporeplace($udata['user_title'])."', "; | ||
| - | $sql .= "detail_firstname = '".aporeplace($udata['user_firstname'])."', "; | ||
| - | $sql .= "detail_lastname = '".aporeplace($udata['user_name'])."', "; | ||
| - | $sql .= "detail_company = '".aporeplace($udata['user_company'])."', "; | ||
| - | $sql .= "detail_street = '".aporeplace($udata['user_street'])."', "; | ||
| - | $sql .= "detail_city = '".aporeplace($udata['user_city'])."', "; | ||
| - | $sql .= "detail_zip = '".aporeplace($udata['user_zip'])."', "; | ||
| - | $sql .= "detail_fon = '".aporeplace($udata['user_tel'])."', "; | ||
| - | $sql .= "detail_notes = '".aporeplace(serialize($profile_data))."', "; | ||
| - | $sql .= "detail_newsletter = '".( empty($udata['user_profile_7'][3]) ? '' : 1 )."', "; | ||
| - | if($udata['user_password']) { | ||
| - | $sql .= "detail_password = '".aporeplace(md5($udata['user_password']))."', "; | ||
| - | } | ||
| - | $sql .= "detail_email = '".aporeplace(strtolower($udata['user_email']))."' "; | ||
| - | $sql .= 'WHERE detail_id=' . intval($_SESSION[ $_loginData['session_key'].'_userdata']['id']).' LIMIT 1'; | ||
| - | |||
| - | $queryResult = _dbQuery($sql, 'UPDATE'); | ||
| - | if(isset($queryResult['AFFECTED_ROWS'])) { | ||
| - | |||
| - | $fe_reg = '<p>Ihre Profildaten wurden erfolgreich aktualisiert</p>' . LF . $fe_reg; | ||
| - | |||
| - | } else { | ||
| - | |||
| - | $fe_reg = '<p class="error">Leider konnten Ihre Anfgaben nicht in der Datenbank gesichert werden. Bitte prüfen Sie Ihre Angaben oder wenden Sie sich an den Systemadministrator.</p>' . LF . $fe_reg; | ||
| - | |||
| - | } | ||
| - | |||
| - | } | ||
| - | |||
| - | } | ||
| - | |||
| - | $content['all'] = str_replace($fe_action, $fe_reg, $content['all']); | ||
| - | |||
| - | } else { | ||
| - | |||
| - | $content['all'] = str_replace('{FE_USER_MANAGE}', '<p class="error">Diese Aktion ist leider nicht zulässig</p>', $content['all']); | ||
| - | |||
| - | } | ||
| - | |||
| - | function is_uerror($field='') { | ||
| - | global $uerror; | ||
| - | if(!empty($uerror[$field])) { | ||
| - | $uerror['status'] = true; | ||
| - | return '<p class="error">' . $uerror[$field] . '</p>'; | ||
| - | } | ||
| - | return ''; | ||
| - | } | ||
| - | |||
| - | |||
| - | ?> | ||
| - | |||
| - | </code> | ||
| ====== Archiv ====== | ====== Archiv ====== | ||
| - | + | Gesammelte ältere Module, die teilweise nicht mehr verfügbar sind, bzw. in andere Form existieren. | |
| - | ===== mod_azlan ===== | + | |
| - | + | ||
| - | + | ||
| - | Nicht mehr verfügbar seit: 03.10.2007 | + | |
| - | + | ||
| - | {{:deutsch:module:azlan.gif|}} | + | |
| - | + | ||
| - | {{:deutsch:module:mod_azlan.zip|mod_azlan.zip}} | + | |
| - | + | ||
| - | \\ | + | |
| - | + | ||
| - | + | ||
| - | ===== mod_floristuser ===== | + | |
| - | + | ||
| - | {{:deutsch:module:florist_user.gif|}} | + | |
| - | + | ||
| - | {{:deutsch:module:mod_floristuser.zip|mod_floristuser.zip}} | + | |
| - | + | ||
| - | \\ | + | |