linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file mod.php

Documentation is available at mod.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage user
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!class_exists('auth')) {
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. //////////// Check Droits utilisateur ////////////
  19. if (!$l21auth->isSuperAdmin()) ReloadIndex('admin');
  20. ////////////
  21.  
  22. include_once('../lib/input_helpers.php');
  23.  
  24. $user_objectnew user;
  25.  
  26. // USER
  27. if (isset($_GET['id']))    $id=$_GET['id'];
  28. if (isset($_POST['id'])) $id=$_POST['id'];
  29.  
  30. $mask_dashboard_1='';
  31. $mask_dashboard_2='';
  32. $mask_publication_1='';
  33. $mask_publication_2='';
  34. $mask_news_1='';
  35. $mask_news_2='';
  36. $mask_workshop_1='';
  37. $mask_workshop_2='';
  38. $mask_display_mail_1='';
  39. $mask_display_mail_2='';
  40.  
  41.  
  42. if(isset($_POST['switch_type'])) {
  43.   $switch_type=$_POST['switch_type'];
  44.  
  45.   $user_objectnew user;
  46.   if($switch_type=='2SIMPLE_USER'$table_right=$user_object->InitUserRight('SIMPLE_USER');
  47.   if($switch_type=='2ADMIN_USER'$table_right=$user_object->InitUserRight('ADMIN_USER');
  48.  
  49.   $result=$user_object->ModifyRight($id$table_right$sql_object);
  50.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."_t&id=".$id;
  51.   if($resultheader("Location: ".$link_confirm);
  52.   else  system_error();
  53. }
  54.  
  55. // préparation des listes Workgroups
  56. $workgroups=$sql_object->DBSelect($q);
  57. $r=$user_object->GetUserWorkshops($id$sql_object);
  58. $default_wgarray();
  59. if($r 0{
  60.     foreach($r as $value{
  61.       if($value['jwu_user_right']=='U')
  62.       array_push($default_wg$value['jwu_workshop_id']);
  63.     }
  64. }
  65.  
  66. $requete=SQL_getAllUserInfo($id);
  67. $data=$sql_object->DBSelect($requete'OBJECT');
  68. if(count($data)>1exit();
  69.  
  70. $current_title $data[0]->user_login;
  71. $user_login $data[0]->user_login;
  72.  
  73. $user_category $data[0]->user_category;
  74. if($user_category==1{
  75.   $switch_type='2SIMPLE_USER';
  76.   $switch_link=_t('user','2SIMPLE_USER');
  77. else {
  78.   $switch_type='2ADMIN_USER';
  79.   $switch_link=_t('user','2ADMIN_USER');
  80. }
  81.  
  82. $switch_form=    "<form id=\"switchform\" name=\"switchform\" action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"post\" >\n";
  83. $switch_form.=    "<div>\n";
  84. $switch_form.=    "<input type=\"hidden\" name=\"switch_type\" id=\"switch_type\" value=\"".$switch_type."\" />\n";
  85. $switch_form.=    "<input name=\"id\" type=\"hidden\" value=\"".$id."\" id=\"idswitch\" />\n";
  86. $switch_form.=    "<input name=\"rub\" type=\"hidden\" value=\"".$rub."\" id=\"rubswitch\" />\n";
  87. $switch_form.=    "<input name=\"todo\" type=\"hidden\" value=\"".$todo."\" id=\"todoswitch\" />\n";
  88. $switch_form.=    "</div>\n";
  89. $switch_form.=    "</form>\n";
  90.  
  91. // droits utilisateur
  92. $rights_id=$data[0]->rights_id;
  93. $form_rights_dashboard=$data[0]->rights_dashboard;
  94. $form_rights_publication=$data[0]->rights_publication;
  95. $form_rights_news=$data[0]->rights_news;
  96. $form_rights_workshop=$data[0]->rights_workshop;
  97.  
  98.  
  99. // profil utilisateur
  100. $profile_id=$data[0]->profile_id;
  101. $form_login $current_login formatText($data[0]->user_login'2FIELD');
  102.  
  103. $form_profile_firstname=formatText($data[0]->profile_firstname'2FIELD');
  104. $form_profile_lastname=formatText($data[0]->profile_lastname'2FIELD');
  105. $form_profile_email $current_email $data[0]->profile_email;
  106. $form_profile_email_display=$data[0]->profile_email_display;
  107. $form_profile_city=formatText($data[0]->profile_city'2FIELD');
  108. $form_profile_birthdateisNullDate($data[0]->profile_birthdate'--' formatDate($data[0]->profile_birthdatetrue);
  109. list($form_date_y$form_date_m$form_date_d)=explode('-'$form_profile_birthdate);
  110. $form_profile_leisures=formatText($data[0]->profile_leisures'2FIELD');
  111. $form_profile_job=formatText($data[0]->profile_job'2FIELD');
  112. $form_profile_avatar=$data[0]->profile_avatar;
  113. $form_profile_quotation=formatText($data[0]->profile_quotation'2FIELD');
  114. $form_profile_signature=formatText($data[0]->profile_signature'2FIELD');
  115. $form_profile_last_modify_display=$data[0]->profile_last_modify_display;
  116.  
  117. if(isset($_POST['valider'])) {
  118.     
  119.   $integrity=1;
  120.  
  121.   $form_login $table_user[0$_POST['pseudo'];
  122.   $form_profile_email $table_profile[0$table_user[1$_POST['email'];
  123.   
  124.   $form_profile_email_display $table_profile[1$_POST['email_display'];
  125.   $form_profile_city $table_profile[2=  $_POST['city'];
  126.   $form_date_d $_POST['date_d'];
  127.   $form_date_m $_POST['date_m'];
  128.   $form_date_y $_POST['date_y'];
  129.   $form_birthdate=$form_date_d '-' $form_date_m '-' $form_date_y;
  130.  
  131.   if(!empty($form_date_d&& !empty($form_date_m&& !empty($form_date_y)) {
  132.     $date_integrity=checkdate_validity($form_birthdate);
  133.   else {
  134.     $date_integrity=true;
  135.   }
  136.   if(is_string($date_integrity)) $integrity $date_integrity;
  137.   else {
  138.     $table_profile[3]$form_date_y.'-'.$form_date_m.'-'.$form_date_d;
  139.     $form_profile_birthdate=$table_profile[3];
  140.     $form_profile_birthdate=formatDate($form_profile_birthdate);
  141.   }
  142.   $table_profile[4$_POST['leisures'];
  143.   $table_profile[5$_POST['job'];
  144.   $table_profile[6$_POST['quotation'];
  145.   $table_profile[7$_POST['signature'];
  146.   $table_profile[8$_POST['first_name'];
  147.   $table_profile[9$_POST['last_name'];
  148.   $table_right['dashboard']=$_POST['dashboard'];
  149.   $table_right['publication']=$_POST['publication'];
  150.   $table_right['news']=$_POST['news'];
  151.   $table_right['workshop']=$_POST['workshop'];
  152.  
  153.   if(is_string($integrity)) $format_text='2FIELD'else $format_text='2HTML';
  154.   $form_profile_firstname formatText($_POST['first_name']$format_text);
  155.   $form_profile_lastname formatText($_POST['last_name']$format_text);
  156.   $form_profile_leisures formatText($_POST['leisures']$format_text);
  157.   $form_profile_job formatText($_POST['job']$format_text);
  158.   $form_profile_quotation formatText($_POST['quotation']$format_text);
  159.   $form_profile_signature formatText($_POST['signature']$format_text);
  160.   $form_rights_dashboard $_POST['dashboard'];
  161.   $form_rights_publication $_POST['publication'];
  162.   $form_rights_news $_POST['news'];
  163.   $form_rights_workshop $_POST['workshop'];
  164.  
  165.   $table_right=urlencode(serialize($table_right));
  166.   $current_email=$_POST['current_email'];
  167.   
  168.   // check if we need to check the login or not
  169.   if($table_user[0== $user_login$checklogin false;
  170.   else $checklogin true;
  171.  
  172.   $data_user_integrity=$user_object->CheckDataIntegrity($table_user$sql_object$checklogin);
  173.   $table_user=urlencode(serialize($table_user));
  174.  
  175.   if(is_string($data_user_integrity)) $integrity=$data_user_integrity;
  176.  
  177.   if(!is_string($integrity)) {
  178.     if(isset($_FILES['avatar']&& $_FILES['avatar']['name']!=''{
  179.       include_once('../class/system/class.upload.php');
  180.       $upload_objectnew upload;
  181.       $upload=$_FILES['avatar'];
  182.       $size_integrity=$upload_object->CheckMaxFile($upload['size']$user_object->UPLOAD_MAX_MO);
  183.       if(is_string($size_integrity)) $integrity=$size_integrity;
  184.       $format_integrity=$upload_object->CheckExtImage($upload['name']);
  185.       if(is_string($format_integrity)) $integrity=$format_integrity;
  186.       if(!is_string($integrity)) {
  187.         $final_name=$id.".".$upload_object->GetExtension($upload ['name']);
  188.         $temp_name="temp_".$final_name;
  189.         $destination="../".$user_object->URI_INPUT;
  190.         $table_profile[10]=$user_object->URI_INPUT.$final_name;
  191.  
  192.         $form_profile_avatar=$user_object->URI_INPUT.$temp_name;
  193.         
  194.         $result_upload=$upload_object->UploadFile($upload$temp_name$destination);
  195.         
  196.         // we remove all images with same name except the image just uploaded
  197.         $upload_object->deleteImages($destination.$final_nametrue);
  198.       }
  199.     else  {
  200.       $table_profile[10]=$form_profile_avatar;
  201.       $archive_it=0;
  202.     }
  203.   }
  204.   $table_profile=urlencode(serialize($table_profile));
  205.  
  206.   if(isset($_POST['workgroups'])) {
  207.     $table_workgroups=$_POST['workgroups'];
  208.     $default_wg=$table_workgroups;
  209.   }
  210.   else $table_workgroups=array();
  211.   $table_workgroups=urlencode(serialize($table_workgroups));
  212. }
  213.  
  214. if(isset($_POST['enregistrer'])) {
  215.     
  216.   $current_email=$_POST['current_email'];
  217.   include_once('../class/system/class.upload.php');
  218.   $table_right=unserialize(urldecode($_POST['table_right']));
  219.   $table_profile=unserialize(urldecode($_POST['table_profile']));
  220.   $table_workgroups=unserialize(urldecode($_POST['table_workgroups']));
  221.   $table_user=unserialize(urldecode($_POST['table_user']));
  222.   $new_email=$table_profile[0];
  223.   $new_login=$table_user[0];
  224.  
  225.   $result1=$user_object->ModifyRight($id$table_right$sql_object);
  226.   $result2=$user_object->ModifyProfile($id$table_profile$sql_object);
  227.   $result3=$user_object->ModifyWorkshops($id$table_workgroups'U' $sql_object);
  228.  
  229.   if($new_email!=$current_email{
  230.     $new_pass=$user_object->GetNewPassword();
  231.     $user_object->UpdateUserPassword($id$new_pass$sql_object);
  232.  
  233.     /** include envoi de mail */
  234.     $todo_mail='change_mail';
  235.     include_once(override('../user/mail_actions.php'));
  236.     include_once(override('../mail/template.php'));
  237.   }
  238.   
  239.   if($new_login != $current_login{
  240.       
  241.       $user_object->changeLogin($id$new_login$current_login$sql_object);
  242.       
  243.       if($new_email != $current_email$user_email $new_email;
  244.       else  $user_email $current_email;
  245.   
  246.       /** include envoi de mail */
  247.       $todo_mail='change_login';
  248.       include_once(override('../user/mail_actions.php'));
  249.       include_once(override('../mail/template.php'));
  250.   }
  251.   
  252.   $upload_objectnew upload;
  253.   $visual_uri="../".$table_profile[10];
  254.   $result_rename=$upload_object->Archivefile($visual_uri);
  255.  
  256.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  257.   if($result1 && $result2 && $result3header("Location: ".$link_confirm);
  258.   else  system_error();
  259. }
  260.  
  261. // préparation des données
  262. if($form_rights_dashboard=='U'$mask_dashboard_1="checked=\"checked\"";
  263. if($form_rights_dashboard=='O'$mask_dashboard_2="checked=\"checked\"";
  264. if($form_rights_publication=='U'$mask_publication_1="checked=\"checked\"";
  265. if($form_rights_publication=='O'$mask_publication_2="checked=\"checked\"";
  266. if($form_rights_news=='U'$mask_news_1="checked=\"checked\"";
  267. if($form_rights_news=='O'$mask_news_2="checked=\"checked\"";
  268. if($form_rights_workshop=='U'$mask_workshop_1="checked=\"checked\"";
  269. if($form_rights_workshop=='O'$mask_workshop_2="checked=\"checked\"";
  270. if($form_profile_email_display=='Y'$mask_display_mail_1="checked=\"checked\"";
  271. if($form_profile_email_display=='N'$mask_display_mail_2="checked=\"checked\"";
  272.  
  273. if(!empty($form_profile_avatar)) {
  274.   $complete_uri='../'.$form_profile_avatar;
  275.   $user_profile_avatar ='<div id="avatarcontainer"><img src="'.$complete_uri.'" alt="'._t('user','avatar').' '.$user_login.'" />';
  276.   if(!isset($integrity)) {
  277.       $user_profile_avatar.='<p><a class="ico_generic2" href="index.php?rub=user&amp;todo=delavatar&amp;id='.$profile_id.'" title="'._t('user','delete_avatar').'"><i class="icon-trash"></i><span>'._t('user','delete_avatar').'</span></a></p>';
  278.   }
  279.   $user_profile_avatar.='</div>';
  280.   // ajax code
  281.   $js '$("a.delete_avatar").click(function() {
  282.  
  283.           var url = "../user/delavatar.php?id='.$id.'&mode=ajax";
  284.           $.ajax({
  285.               type: "GET",
  286.               url: url,
  287.               dataType: "json",
  288.               success: function(data){
  289.                   if(data.status==1) {
  290.                       humane.success = humane.spawn({ addnCls: "humane-jackedup-success"});
  291.                       humane.success(data.msg);
  292.                       $("#avatarcontainer").fadeOut("slow");
  293.                   } else {
  294.                     humane.error = humane.spawn({ addnCls: "humane-jackedup-error"});
  295.                       humane.error(data.msg);
  296.                   }
  297.               }
  298.           });
  299.           return false;
  300.       });  
  301.   ';
  302.   
  303.  
  304.  
  305. else $user_profile_avatar=_t('divers','none');
  306.  
  307.  
  308. // preparation affichage detaillé
  309. $rights_display='';
  310. if(defined('MOD_SDI'&& $user_category!=1{
  311.   $rights_display.= "<div><div class=\"rights\">⇨ "._t('menu','dashboard')." : </div>\n";
  312.   $rights_display.= "<div class=\"rightpanel\">\n";
  313.   $rights_display.= "<input type=\"radio\" id=\"dashboard_1\" class=\"radio\" name=\"dashboard\" value=\"U\" ".$mask_dashboard_1." /><label for=\"dashboard_1\">"_t('user','norights')."</label>\n";
  314.   $rights_display.= "<input type=\"radio\" id=\"dashboard_2\" class=\"radio\" name=\"dashboard\" value=\"O\" ".$mask_dashboard_2."/><label for=\"dashboard_2\">"_t('user','managerrights')."</label>\n";
  315.   $rights_display.= "</div></div>\n";
  316. else $rights_display.="<input type=\"hidden\" id=\"dashboard\" name=\"dashboard\" value=\"".$form_rights_dashboard."\" />\n";
  317. if(defined('MOD_PUBLICATION'&& $user_category!=1{
  318.   $rights_display.= "<div><div class=\"rights\">⇨ "._t('menu','publication')." : </div>\n";
  319.   $rights_display.= "<div class=\"rightpanel\">\n";
  320.   $rights_display.= "<input type=\"radio\" id=\"publication_1\" class=\"radio\" name=\"publication\" value=\"U\" ".$mask_publication_1." /><label for=\"publication_1\">"_t('user','norights')."</label>\n";
  321.   $rights_display.= "<input type=\"radio\" id=\"publication_2\" class=\"radio\" name=\"publication\" value=\"O\" ".$mask_publication_2." /><label for=\"publication_2\">"_t('user','redactorrights')."</label>\n";
  322.   $rights_display.= "</div></div>\n";
  323. else $rights_display.="<input type=\"hidden\" id=\"publication\" name=\"publication\" value=\"".$form_rights_publication."\" />\n";
  324. if(defined('MOD_NEWS'&& $user_category!=1{
  325.   $rights_display.= "<div><div class=\"rights\">⇨ "._t('menu','news')." : </div>\n";
  326.   $rights_display.= "<div class=\"rightpanel\">\n";
  327.   $rights_display.= "<input type=\"radio\" id=\"news_1\" class=\"radio\" name=\"news\" value=\"U\" ".$mask_news_1." /><label for=\"news_1\">"_t('user','norights')."</label>\n";
  328.   $rights_display.= "<input type=\"radio\" id=\"news_2\" class=\"radio\" name=\"news\" value=\"O\" ".$mask_news_2."/><label for=\"news_2\">"_t('user','redactorrights')."</label>\n";
  329.   $rights_display.= "</div></div>\n";
  330. else $rights_display.="<input type=\"hidden\" id=\"news\" name=\"news\" value=\"".$form_rights_news."\" />\n";
  331. if(defined('MOD_WORKSHOP'&& $user_category!=1{
  332.   $rights_display.= "<div><div class=\"rights\">⇨ "._t('menu','workshop')." : </div>\n";
  333.   $rights_display.= "<div class=\"rightpanel\">\n";
  334.   $rights_display.= "<input type=\"radio\" id=\"workshop_1\" class=\"radio\" name=\"workshop\" value=\"U\" ".$mask_workshop_1." /><label for=\"workshop_1\">"_t('user','norights')."</label>\n";
  335.   $rights_display.= "<input type=\"radio\" id=\"workshop_2\" class=\"radio\" name=\"workshop\" value=\"O\" ".$mask_workshop_2." /><label for=\"workshop_2\">"_t('user','animatorrights')."</label>\n";
  336.   $rights_display.= "</div></div>\n";
  337. else $rights_display.="<input type=\"hidden\" id=\"wokshop\" name=\"workshop\" value=\"".$form_rights_workshop."\" />\n";
  338. if($user_category==1{
  339.   $rights_display.="<p class=\"info\">\n";
  340.   $rights_display.=_t('user','admin_type_info');
  341.   $rights_display.="\n</p>\n";
  342. }
  343.  
  344. // Restriction on changing emails and passwords for LDAP users
  345. if($data[0]->user_password  == '@ldap_forward'{
  346.     $mask ' readonly = "readonly"';
  347. else {
  348.     $mask '';
  349. }
  350. ?>
  351. <div id="chemin">
  352. <ul>
  353.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  354.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','user')?></a></li>
  355.     <li><span><?php echo formatNavTitle(_t('user','mod').' : '.$current_title)?></span></li>
  356. </ul>
  357. </div>
  358. <!--end barre haute -->
  359. <?php
  360. include_once(THEME_ADMIN_PATH."quickicons.php");
  361. ?>
  362.  
  363. <?php
  364. if(!isset($integrity|| is_string($integrity)) {
  365. ?>
  366. <div class="contentcontainer"><?php
  367. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  368. ?>
  369. <div id="content">
  370. <?php
  371.  
  372. if($data[0]->user_password == '@ldap_forward'{
  373.     $suffix'<i class="icon-universal-access"></i>';
  374. else {
  375.     $suffix' ';
  376. }
  377.  
  378. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  379. ?>
  380. <h2><?php echo formatTitleh2($current_title).$suffix?></h2>
  381. <div class="mod_link">
  382. <?php 
  383. // if user is authentified using LDAP, no ability to change password
  384. if($data[0]->user_password != '@ldap_forward'
  385. ?>
  386.     <a href="<?php echo $rub_link."&amp;todo=mod_p&amp;id=".$id?>"><?php echo _t('user','new_password')?></a>
  387.     | 
  388. <?php }
  389.  
  390. echo "<a href=\"#\" onclick=\"document.getElementById('switchform').submit()\">".$switch_link."</a>"?>
  391. <br />
  392.  
  393. </div>
  394. <form id="moduser" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post" enctype="multipart/form-data">
  395.  
  396. <h3 class="part"><?php echo mb_ucfirst(_t('user','update_rights'))?></h3>
  397. <?php echo $rights_display?>
  398.  
  399. <h3 class="part"><?php echo mb_ucfirst(_t('user','profile'))?></h3>
  400.  
  401.  
  402. <p>
  403.     <label for="pseudo"><?php echo mb_ucfirst(_t('user','login'))?> : *</label>
  404.     <input name="pseudo" type="text" class="textfield" id="pseudo"<?php echo $mask?> maxlength="150" value="<?php echo $form_login?>" />
  405. </p>
  406. <p>
  407. <label for="email"><?php echo mb_ucfirst(_t('user','email'))?> : *</label>
  408. <input name="email" type="text" class="textfield" id="email" maxlength="200"<?php echo $mask?> value="<?php echo $form_profile_email?>" />
  409. </p>
  410. <div class="label"><?php echo mb_ucfirst(_t('user','email_display'))?> : </div>
  411. <div class="rightpanel">
  412.     <input type="radio" id="email_display_Y" name="email_display" value="Y" <?php echo $mask_display_mail_1?> />
  413.     <label for="email_display_Y"><?php echo _t('divers','yes')?></label>
  414.     <input type="radio" id="email_display_N" name="email_display" value="N" <?php echo $mask_display_mail_2?> />
  415.     <label for="email_display_N"><?php echo _t('divers','no')?></label>
  416. </div>
  417. <p>
  418. <label for="first_name"><?php echo mb_ucfirst(_t('user','first_name'))?> :</label>
  419. <input name="first_name" type="text" class="textfield" id="first_name" maxlength="200" value="<?php echo $form_profile_firstname?>" />
  420. </p>
  421. <p>
  422. <label for="last_name"><?php echo mb_ucfirst(_t('user','last_name'))?> :</label>
  423. <input name="last_name" type="text" class="textfield" id="last_name" maxlength="200" value="<?php echo $form_profile_lastname?>" />
  424. </p>
  425. <div class="label"><?php echo mb_ucfirst(_t('user','workgroups'))?> :</div>
  426. <div class="rightpanel" id="groups"><?php echo workgroupsCheckbox($workgroups'workgroups[]'$default_wg)?>
  427. </div>
  428.  
  429. <dl class="dl_mod">
  430.     <dt><?php echo _t('user','avatar')?></dt>
  431.     <dd><?php echo $user_profile_avatar?></dd>
  432. </dl>
  433.  
  434. <p>
  435. <label for="avatar"><?php echo mb_ucfirst(_t('user','avatar'))?> : </label>
  436. <input name="avatar" type="file" id="avatar" size="47" class="file" />
  437. </p>
  438. <p>
  439. <label for="birthdate_d"><?php echo mb_ucfirst(_t('user','birthdate'))?> :</label>
  440. <?php echo input_date($form_date_y$form_date_m$form_date_d)?>
  441. </p>
  442. <p>
  443. <label for="city"><?php echo mb_ucfirst(_t('user','city'))?> :</label>
  444. <input name="city" type="text" class="textfield" id="city" maxlength="100" value="<?php echo $form_profile_city?>" />
  445. </p>
  446. <p>
  447. <label for="leisures"><?php echo mb_ucfirst(_t('user','leisures'))?> :</label>
  448. <input name="leisures" type="text" class="textfield" id="leisures" maxlength="150" value="<?php echo $form_profile_leisures?>" />
  449. </p>
  450. <p>
  451. <label for="job"><?php echo mb_ucfirst(_t('user','job'))?> :</label>
  452. <input name="job" type="text" class="textfield" id="job" maxlength="150" value="<?php echo $form_profile_job?>" />
  453. </p>
  454. <p>
  455. <label for="quotation"><?php echo mb_ucfirst(_t('user','quotation'))?> :</label>
  456. <input name="quotation" type="text" class="textfield" id="quotation" maxlength="150" value="<?php echo $form_profile_quotation?>" />
  457. </p>
  458. <p>
  459. <label for="signature"><?php echo mb_ucfirst(_t('user','signature'))?> :</label>
  460. <input name="signature" type="text" class="textfield" id="signature" maxlength="200" value="<?php echo $form_profile_signature?>" />
  461. </p>
  462. <div>
  463.   <input name="current_email" type="hidden" value="<?php echo $current_email?>" id="current_email" />
  464.   <input name="current_login" type="hidden" value="<?php echo $current_login?>" id="current_login" />
  465.   <input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  466.   <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  467.   <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  468.   <?php echo cancel_button('javascript:history.go(-1);')?>
  469.   <input name="valider" type="submit"    value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  470. </div>
  471. </form>
  472.     <?php echo $switch_form?></div>
  473.     <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>
  474.     
  475.     <?php
  476.     // Récapitulatif
  477. else    {
  478.  
  479.   $wg_display '';
  480.   if(isset($_POST['workgroups'])) {
  481.     $q=SQL_Get_WorkshopsDenomination($_POST['workgroups']);
  482.     $workgroups=$sql_object->DBSelect($q);
  483.     foreach($workgroups as $wg{
  484.       $wg_display .= '- '.$wg['workshop_denomination'].'<br />'.END_LINE;
  485.     }
  486.   else $wg_display .= _t('divers''none');
  487.  
  488.   //prepa affichage de droits
  489.   $reca_droits='';
  490.   $reca_droits.='<h3 class="part">'._t('user','rights').'</h3>';
  491.   $reca_droits.="<dl class=\"summary\">\n";
  492.   if(defined('MOD_SDI'))  {
  493.     $reca_droits.="<dt> . "._t('menu','sdi')."</dt>\n";
  494.     $reca_droits.="<dd>".GetDisplayUserRight($form_rights_dashboard'dashboard')."<br /></dd>\n";
  495.   }
  496.   if(defined('MOD_PUBLICATION'))  {
  497.     $reca_droits.="<dt>  . "._t('menu','publication')."</dt>\n";
  498.     $reca_droits.="<dd>".GetDisplayUserRight($form_rights_publication)."<br /></dd>\n";
  499.   }
  500.   if(defined('MOD_WORKSHOP'))  {
  501.     $reca_droits.="<dt>  . "._t('menu','workshop')."</dt>\n";
  502.     $reca_droits.="<dd>".GetDisplayUserRight($form_rights_workshop'workshop')."<br /></dd>\n";
  503.   }
  504.   if(defined('MOD_NEWS'))  {
  505.     $reca_droits.="<dt>  . "._t('menu','news')."</dt>\n";
  506.     $reca_droits.="<dd>".GetDisplayUserRight($form_rights_news)."<br /></dd>\n";
  507.   }
  508.   $reca_droits.="</dl>\n";
  509.  
  510.  
  511.   if($form_profile_email_display=='Y'$form_profile_email_string=_t('divers','yes');
  512.   if($form_profile_email_display=='N'$form_profile_email_string=_t('divers','no');
  513.   $form_profile_email='<a href="mailto:'.$form_profile_email.'">'.$form_profile_email.'</a>';
  514.   $form_profile_firstname=empty_nc($form_profile_firstname);
  515.   $form_profile_lastname=empty_nc($form_profile_lastname);
  516.   $form_profile_city=empty_nc($form_profile_city);
  517.   $form_profile_birthdate ($form_profile_birthdate=='--''' $form_profile_birthdate;
  518.   $form_profile_birthdate=empty_nc($form_profile_birthdate);
  519.   $form_profile_leisures=empty_nc($form_profile_leisures);
  520.   $form_profile_job=empty_nc($form_profile_job);
  521.   $user_profile_avatar=empty_none($user_profile_avatar);
  522.   $form_profile_signature=empty_nc($form_profile_signature);
  523.   $form_profile_quotation=empty_nc($form_profile_quotation);
  524.   ?>
  525. <div class="contentcontainer"><?php
  526. include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  527. ?>
  528. <div id="content"><?php
  529. echo "<h2>".formatTitleh2(_t('recap','title')).$suffix."</h2>";
  530. echo $reca_droits;
  531. echo '<h3 class="part">'._t('user','profile').'</h3>';
  532. echo "<dl class=\"summary\">\n";
  533. echo "<dt>"mb_ucfirst(_t('user','login'))" :</dt>\n";
  534. echo "<dd>".$form_login."</dd>\n";
  535. echo "<dt>"mb_ucfirst(_t('user','email'))" :</dt>\n";
  536. echo "<dd>".$form_profile_email."</dd>\n";
  537. echo "<dt>".mb_ucfirst(_t('user','email_display'))." :</dt>\n";
  538. echo "<dd>"$form_profile_email_string."</dd>\n";
  539. echo "<dt>"mb_ucfirst(_t('user','first_name'))" :</dt>\n";
  540. echo "<dd>".$form_profile_firstname."</dd>\n";
  541. echo "<dt>"mb_ucfirst(_t('user','last_name'))" :</dt>\n";
  542. echo "<dd>".$form_profile_lastname."</dd>\n";
  543. echo "<dt>".ucfirst(_t('user','workgroups'))." :</dt>\n";
  544. echo "<dd>"stripslashes($wg_display)."</dd>\n";
  545. echo "<dt>"mb_ucfirst(_t('user','birthdate'))." :</dt>\n";
  546. echo "<dd>"stripslashes($form_profile_birthdate)."</dd>\n";
  547. echo "<dt>"mb_ucfirst(_t('user','city'))." :</dt>\n";
  548. echo "<dd>"stripslashes($form_profile_city)."</dd>\n";
  549. echo "<dt>"mb_ucfirst(_t('user','leisures'))." :</dt>\n";
  550. echo "<dd>"stripslashes($form_profile_leisures)."</dd>\n";
  551. echo "<dt>"mb_ucfirst(_t('user','job'))." :</dt>\n";
  552. echo "<dd>"stripslashes($form_profile_job)."</dd>\n";
  553. echo "<dt>"mb_ucfirst(_t('user','avatar'))." :</dt>\n";
  554. echo "<dd>"stripslashes($user_profile_avatar)."</dd>\n";
  555. echo "<dt>"mb_ucfirst(_t('user','quotation'))." :</dt>\n";
  556. echo "<dd>"stripslashes($form_profile_quotation)."</dd>\n";
  557. echo "<dt>"mb_ucfirst(_t('user','signature'))." :</dt>\n";
  558. echo "<dd>"stripslashes($form_profile_signature)."</dd>\n";
  559. echo "</dl>\n";
  560. ?>
  561. <form id="moduser" action="<?php echo $_SERVER['SCRIPT_NAME']?>"    method="post">
  562.    <div>
  563.     <input name="id" type="hidden" value="<?php echo $id?>" id="id" />
  564.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  565.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  566.     <input name="current_email" type="hidden" value="<?php echo $current_email?>" id="current_email" />
  567.     <input name="current_login" type="hidden" value="<?php echo $current_login?>" id="current_login" />
  568.     <input name="table_right" type="hidden" value="<?php echo $table_right?>" id="table_right" />
  569.     <input name="table_profile" type="hidden" value="<?php echo $table_profile?>" id="table_profile" />
  570.     <input name="table_user" type="hidden" value="<?php echo $table_user?>" id="table_user" />
  571.     <input name="table_workgroups" type="hidden" value="<?php echo $table_workgroups?>" id="table_workgroups" />
  572.     <?php echo cancel_button('?rub=user&amp;todo=list')?>
  573.     <input name="retour" type="button" value="<?php echo _t('btn','preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  574.     <input name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>" class="button" id="valider" />
  575.   </div>
  576. </form>
  577. </div>
  578. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>
  579. <?php
  580. }
  581. ?>

Documentation generated on Thu, 20 Mar 2014 16:49:00 +0100 by phpDocumentor 1.4.1