plugins/SpecialUserPrefs.php
changeset 1069 d54e7620bd3e
parent 1064 5a34101dfcf9
child 1079 fcc42560afe6
equal deleted inserted replaced
1068:4bcefa85649c 1069:d54e7620bd3e
   114   global $db, $session, $paths, $template, $plugins; // Common objects
   114   global $db, $session, $paths, $template, $plugins; // Common objects
   115   global $userprefs_menu_links;
   115   global $userprefs_menu_links;
   116   
   116   
   117   userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_emailpassword', makeUrlNS('Special', 'Preferences/EmailPassword') . '" onclick="ajaxLoginNavTo(\'Special\', \'Preferences/EmailPassword\', '.USER_LEVEL_CHPREF.'); return false;');
   117   userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_emailpassword', makeUrlNS('Special', 'Preferences/EmailPassword') . '" onclick="ajaxLoginNavTo(\'Special\', \'Preferences/EmailPassword\', '.USER_LEVEL_CHPREF.'); return false;');
   118   userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_signature', makeUrlNS('Special', 'Preferences/Signature'));
   118   userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_signature', makeUrlNS('Special', 'Preferences/Signature'));
   119   userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_publicinfo', makeUrlNS('Special', 'Preferences/Profile'));
   119   // userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_publicinfo', makeUrlNS('Special', 'Preferences/Profile'));
   120   userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_usergroups', makeUrlNS('Special', 'Usergroups'));
   120   userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_usergroups', makeUrlNS('Special', 'Usergroups'));
   121   if ( getConfig('avatar_enable') == '1' )
   121   if ( getConfig('avatar_enable') == '1' )
   122   {
   122   {
   123     userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_avatar', makeUrlNS('Special', 'Preferences/Avatar'));
   123     userprefs_menu_add('usercp_sec_profile', 'usercp_sec_profile_avatar', makeUrlNS('Special', 'Preferences/Avatar'));
   124   }
   124   }
   297   
   297   
   298   userprefs_show_menu();
   298   userprefs_show_menu();
   299   
   299   
   300   switch ( $section )
   300   switch ( $section )
   301   {
   301   {
   302     case 'Home':
       
   303       global $email;
       
   304       $userpage_id = $paths->nslist['User'] . sanitize_page_id($session->username);
       
   305       $userpage_exists = ( isPage($userpage_id) ) ? '' : ' class="wikilink-nonexistent"';
       
   306       $user_page = makeUrlNS('User', sanitize_page_id($session->username));
       
   307       $site_admin = $email->encryptEmail(getConfig('contact_email'), '', '', $lang->get('usercp_intro_para3_admin_link'));
       
   308       
       
   309       echo '<h3 style="margin-top: 0;">' . $lang->get('usercp_intro_heading_main', array('username' => $session->username)) . '</h3>';
       
   310       
       
   311       echo '<p>' . $lang->get('usercp_intro_para1') . '</p>
       
   312             <p>' . $lang->get('usercp_intro_para2', array('userpage_link' => $user_page)) . '</p>
       
   313             <p>' . $lang->get('usercp_intro_para3', array('admin_contact_link' => $site_admin)) . '</p>';
       
   314       break;
       
   315     case 'EmailPassword':
   302     case 'EmailPassword':
   316       
   303       
   317       $errors = trim($errors);
   304       $errors = trim($errors);
   318       if ( !empty($errors) )
   305       if ( !empty($errors) )
   319       {
   306       {
   378       echo $template->tinymce_textarea('new_sig', htmlspecialchars($session->signature));
   365       echo $template->tinymce_textarea('new_sig', htmlspecialchars($session->signature));
   379       echo '<input type="submit" value="' . $lang->get('usercp_signature_btn_save') . '" />';
   366       echo '<input type="submit" value="' . $lang->get('usercp_signature_btn_save') . '" />';
   380       echo '</form>';
   367       echo '</form>';
   381       break;
   368       break;
   382     case "Profile":
   369     case "Profile":
       
   370     case 'Home':
       
   371       
       
   372       global $email;
       
   373       $userpage_id = $paths->nslist['User'] . sanitize_page_id($session->username);
       
   374       $userpage_exists = ( isPage($userpage_id) ) ? '' : ' class="wikilink-nonexistent"';
       
   375       $user_page = makeUrlNS('User', sanitize_page_id($session->username));
       
   376       $site_admin = $email->encryptEmail(getConfig('contact_email'), '', '', $lang->get('usercp_intro_para3_admin_link'));
       
   377       
       
   378       echo '<h3 style="margin-top: 0;">' . $lang->get('usercp_intro_heading_main', array('username' => $session->username)) . '</h3>';
       
   379       
       
   380       echo  $lang->get('usercp_intro', array('userpage_link' => $user_page));
       
   381       
   383       $available_ranks = $session->get_user_possible_ranks($session->user_id);
   382       $available_ranks = $session->get_user_possible_ranks($session->user_id);
   384       $current_rank = $session->get_user_rank($session->user_id);
   383       $current_rank = $session->get_user_rank($session->user_id);
   385       
   384       
   386       if ( isset($_POST['submit']) )
   385       if ( isset($_POST['submit']) )
   387       {
   386       {