Subversion Repositories wimsdev

Rev

Rev 9475 | Rev 10769 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !read adm/language lang/names.phtml
  2.  
  3. !read adm/language adm/lang/external_auth.phtml
  4. !read adm/css.phtml
  5. !header1
  6.  
  7. !read adm/title.phtml 1\
  8. WIMS $httpd_HTTP_HOST\
  9. $name_title
  10.  
  11. !if $cltype iswordof 2 4 and $classcnt>0
  12.  <p class="wimscenter">
  13.  ($name_reserved)
  14.  </p>
  15. !endif
  16. !if $error!=$empty
  17.  <div class="wims_msg alert">
  18.  !read lang/msg.phtml.$modu_lang
  19.  </div>
  20.  <p>
  21.  !set wims_ref_class=wims_button
  22.  !href cmd=new&step=1 $wims_name_back2
  23.  </p>
  24.  !goto end1
  25. !endif
  26.  
  27. !if $classcnt=0
  28.   $name_warning1
  29.  !goto end
  30. !endif
  31.  
  32. !if $class=$empty
  33.  $name_inscription
  34.  
  35.  $table_header
  36.  !if $ctype=0
  37.   $table_hdtr
  38.   <th>$wims_name_name</th><th>$wims_name_nameteacher</th><th>$wims_name_level</th><th>$wims_name_Language</th>
  39.   <th>$name_remainig</th><th>$wims_name_Status</th>
  40.  !else
  41.   <caption>$institution_name</caption>
  42.   $table_hdtr
  43.   <th>$wims_name_name</th><th>$wims_name_Supervisor</th><th>$wims_name_level</th>
  44.   <th>$wims_name_Status</th></tr>
  45.  !endif
  46.  !for cl in $classlist
  47.   !reset class_supervisor,class_email,class_level,class_lang,class_institution,class_description,class_password,class_limit
  48.   !defread wimshome/log/classes/$cl/.def
  49.   !distribute char $class_level into l1,l2
  50.   !set part=!recordcnt wimshome/log/classes/$cl/.userlist
  51.   $table_tr<td>
  52.   !if $ctype=0
  53.    !href module=$module&cmd=reply&class=$cl $class_institution<br />$class_description
  54.   !else
  55.    !href module=$module&cmd=reply&class=$cl $class_description
  56.   !endif
  57.   </td><td>
  58.   !mailurl $class_email $class_supervisor
  59.   </td>
  60.   !if $class_level=$empty
  61.    !set pname=!defof class_description in wimshome/log/classes/$class_parent/.def
  62.     <td>$pname</td>
  63.   !else
  64.     <td>$(level$l1)<br />$name_year $l2</td>
  65.   !endif
  66.   !if $ctype=0
  67.    <td>$(lang_$class_lang)</td>
  68.    <td style="text-align:right">
  69.    !if $class_limit-$part>$site_dispo
  70.     $site_dispo
  71.    !else
  72.     $[$class_limit-$part]
  73.    !endif
  74.    </td>
  75.   !endif
  76.   !if $class_password=$empty
  77.    <td>$(name_statut[1])</td>
  78.   !else
  79.    <td>$(name_statut[2])</td>
  80.   !endif
  81.   </tr>
  82.  !next cl
  83.  $table_end
  84.  
  85.  <span class="wims_warning">$wims_name_warning</span>. $name_remark1
  86.  !goto end1
  87. !endif class=empty
  88.  
  89. !read adm/class/classname.phtml $description\
  90. $institution
  91.  
  92. !! if class_mixed_external_auth not 0 show message in and class_external_auth
  93. !! and when class_mixed_external_auth=2 also disable the registration form
  94. !! please check! thanks!
  95. !default authreg=0
  96. !if $cltype=1
  97.   !set authreg=!defof class_mixed_external_auth in wimshome/log/classes/$class_parent/.def
  98.   !set extauth=!defof class_external_auth in wimshome/log/classes/$class_parent/.def
  99.   !set usuperv=!defof user_supervisable in wimshome/log/classes/$class_parent/.users/$wims_user
  100. !endif
  101. !if $cltype=0
  102.   !set super_mixed_auth=!defof class_mixed_external_auth in wimshome/log/classes/$class_superclass/.def
  103.   !if $super_mixed_auth=2
  104.     !set authreg=$super_mixed_auth
  105.     !set extauth=!defof class_external_auth in wimshome/log/classes/$class_superclass/.def
  106.   !else
  107.     !set authreg=$class_mixed_external_auth
  108.     !set extauth=!defof class_external_auth in wimshome/log/classes/$class/.def
  109.   !endif
  110.   !! do we really need this for $cltype=0?
  111.   !set usuperv=!defof user_supervisable in wimshome/log/classes/$class/.users/$wims_user
  112. !endif
  113. !! need to check if supervisor in order to allow user management by supervisor
  114. !! need to check if user_supervisable for direct access from module=home
  115. !!  anything else?
  116. !if $wims_user!=supervisor and $usuperv!=yes and $authreg iswordof 1 2 and $cltype iswordof 0 1
  117.   <div class="wims_external_auth">
  118.   $extauth
  119.   </div>
  120.   !if $authreg=2
  121.     !goto end1
  122.   !endif
  123. !endif
  124.  
  125. !if $password!=$empty and $passverify=$empty
  126.  !if $cltype iswordof 2 4
  127.   $name_classessss
  128.   !href module=adm/class/classes&type=authparticipant&class=$class $classname
  129.  !else
  130.   $name_classessss
  131.   !href module=adm/class/classes&type=authparticipant&class=$class $classname
  132.  !endif
  133.  !if $cltype iswordof 4 2
  134.   $name_warning_protected
  135.   !if $classcnt>0
  136.   $name_inscription_student
  137.   !href cmd=new&module=$module&class=$class&subclass=yes $name_inyourclass
  138. .
  139.   !endif
  140.  !else
  141.   $name_isprotected
  142.  !endif
  143.  <p> $name_writepasswd
  144.  !if $cltype iswordof 2 4
  145.   $name_asateacher.
  146.  !else
  147.   $name_asaparticipant.
  148.  !endif
  149.  </p>
  150.  
  151.  !form reply
  152.  <input type="hidden" name="step" value="1" />
  153.  <fieldset class="property_fields halfwidth blockcenter">
  154.    <legend>$name_title</legend>
  155.    <div class="field box">
  156.     <label for="classpass">$wims_name_Password</label>
  157.     <input type="password" name="classpass" id="classpass" required="required" placeholder="$wims_name_Password"/>
  158.    </div>
  159.    <div class="wimscenter wimsform">
  160.     <input type="submit" value="$wims_name_send" />
  161.    </div>
  162.  </fieldset>
  163. !formend
  164.  <span class="wims_warning">$wims_name_warning</span>.
  165.  !if $cltype iswordof 2 4
  166.   $name_access1
  167.  !else
  168.   $name_access2
  169.  !endif
  170.  $name_obtainpasswd
  171. (
  172.  !if $cltype iswordof 2 4
  173.   !mailurl $smail $name_write_adm
  174.  !else
  175.   !mailurl $smail $wims_name_wsup
  176.  !endif
  177. ).
  178.  !if $cltype iswordof 2 4
  179.  <p>
  180.  <span class="wims_warning">$wims_name_warning</span>. $name_warning_direct
  181.   !href cmd=new&module=$module&class=$class&subclass=yes $name_inyourclass
  182. .
  183.   </p>
  184.  !endif
  185.  !goto end1
  186. !endif
  187.  
  188. !if $step=$empty or $step<2
  189.  !if $ssclass!=$empty and $wims_class!=$ssclass and $wims_user=supervisor
  190.   !form reply
  191.   <input type="hidden" name="step" value="1" />
  192.   <label for="search">$name_research:</label>
  193.   <input size="20" name="search" id="search" value="$search" />
  194.   <input type="submit" value="$wims_name_tosave" />
  195.  
  196.  !formend
  197.   !default foundcnt=0
  198.   !if $foundcnt>0
  199.    $table_header
  200.    <caption>$name_clickname</caption>
  201.    $table_hdtr<th>$wims_name_name</th><th>$wims_name_Login</th></tr>
  202.    !for i=1 to $foundcnt
  203.     !set l=!line $i of $found
  204.     !distribute item $l into l_,f_,L_
  205.     $table_tr<td>
  206.     !href cmd=reply&step=2&login=$L_ $l_, $f_
  207.     </td>
  208.     <td>$L_</td></tr>
  209.    !next i
  210.    $table_end
  211.    !goto end1
  212.   !endif
  213.   !if $search!=$empty and $foundcnt=0
  214.   <p> ($name_nofound) </p>
  215.   !endif
  216.   $name_newparticipant
  217.  !else
  218.   !if $idp_method notitemof $idp_method_list
  219.   $name_inscription2
  220.   !endif
  221.  !endif
  222.   !form reply
  223. !! check user supervisor??
  224.  
  225.  !if $idp_method isitemof $idp_method_list and $auth_user$user_auth!=$empty and $wims_user!=supervisor
  226.    <input type="hidden" name="step" value="3" />
  227. $name_inscription4:
  228. <p>
  229.  !formcheckbox agreecgu list yes prompt <label for="agreecgu0">$name_cgu</label>
  230.    [
  231.   !href cmd=help $name_seecgu
  232.   ]
  233. </p>
  234. <div class="wimscenter wimsform"><input type="submit" value="$wims_name_tosave" /></div>
  235.    !goto end1
  236.  !endif
  237. !!FIXME  $auth_user=$empty
  238.  !if $wims_user=supervisor and $auth_user=$empty
  239.  
  240. !! teacher registering a student with idp ldap
  241.     !if $idp_method isitemof ldap
  242.     <span class="wims_warning">$name_login_external ($name_idp_external)</span>:
  243.  
  244. !!!FIXME check the value of step
  245.         <input type="hidden" name="step" value="3" />
  246.         <fieldset class="property_fields halfwidth blockcenter">
  247.         <legend>$name_title</legend>
  248.           <div class="field box">
  249.             <label for="user_auth">$wims_name_Login ($name_external)</label>
  250.            <input size="16" name="user_auth" id="user_auth" value="$user_auth" />
  251.           </div>
  252.           !set ct=!defof class_type in wimshome/log/classes/$class/.def
  253.         !if $wims_user=supervisor and $class=$wims_class and $ct iswordof 2 4
  254.          <div class="field box">
  255.           <label for="utype">$name_accounttype</label>
  256.           !default utype=0
  257.           !set wims_ref_class=wims_formradio
  258.           !formradio utype list 0,1 prompt $wims_name_namestudent,$wims_name_nameteacher
  259.          </div>
  260.         !endif
  261.           <div class="wimscenter wimsform">
  262.             <input type="submit" value="$wims_name_tosave" />
  263.           </div>
  264.          </fieldset>
  265.  
  266. !formend
  267.      !goto end1
  268.     !endif
  269. !! teacher registering a student with external auth without idp ldap
  270.     !if $auth_method isitemof $auth_method_list
  271.     <input type="hidden" name="step" value="3" />
  272.     <fieldset class="property_fields halfwidth blockcenter">
  273.       <legend>$name_title</legend>
  274.       <div class="field box halfwidth">
  275.        <label for="lastn">$wims_name_lastname</label>
  276.        <input size="20" name="lastn" id="lastn" value="$lastn" />
  277.       </div>
  278.       <div class="field box halfwidth">
  279.        <label for="firstn">$wims_name_firstname</label>
  280.        <input size="20" name="firstn" id="firstn" value="$firstn" />
  281.       </div>
  282.       <div class="field box">
  283.        <label for="user_auth">$wims_name_Login </label>
  284.        <input size="16" name="user_auth" id="user_auth" value="$user_auth" />
  285.        <div class="formHelp">$name_external,
  286.         <span class="wims_warning">$name_login_external_warning</span>
  287.        </div>
  288.       </div>
  289.       <div class="field box">
  290.        <label for="email">$wims_name_email</label>
  291.        <input type="email" size="60" name="email" id="email" value="$email" />
  292.        <div class="formHelp">$name_optional</div>
  293.       </div>
  294.       <div class="wimscenter wimsform">
  295.        <input type="submit" value="$wims_name_tosave" />
  296.       </div>
  297.     </fieldset>
  298.  
  299.  
  300. !formend
  301.      !goto end1
  302.     !endif
  303.  !endif
  304.  !if $auth_user=$empty or $auth_method notitemof $auth_method_list
  305.  !!read adm/language lang/names.phtml
  306.   <input type="hidden" name="step" value="2" />
  307.  !else
  308.   <input type="hidden" name="step" value="3" />
  309.  !endif
  310.   <fieldset class="property_fields halfwidth blockcenter">
  311.    <legend>$name_title</legend>
  312.    <div class="field box halfwidth">
  313.     <label for="lastn">$wims_name_lastname</label>
  314.     <input size="20" name="lastn" id="lastn" value="$lastn" />
  315.    </div>
  316.    <div class="field box halfwidth">
  317.     <label for="firstn">$wims_name_firstname</label>
  318.     <input size="20" name="firstn" id="firstn" value="$firstn" />
  319.    </div>
  320.  !if $wims_user=supervisor
  321.    !reset login
  322.  !endif
  323.  !if ($auth_user=$empty or $auth_method notitemof $auth_method_list) or $wims_user=supervisor
  324.    <div class="field box">
  325.     <label for="login">$wims_name_Login</label>
  326.     <input size="16" name="login" id="login" value="$login" />
  327.     !if $auth_method notitemof $auth_method_list or $wims_user!=supervisor
  328.        <div class="formHelp">$name_warning_login</div>
  329.     !endif
  330.    !if $auth_method isitemof $auth_method_list and $wims_user=supervisor
  331.     !reset login_ext
  332.      <label for="login_ext">$wims_name_Login</label>
  333.      <input size="16" name="login_ext" id="login_ext" value="$login_ext" />
  334.      <div class="formHelp">$name_external
  335.       <span class="wims_warning">$name_login_external_warning</span>
  336.      </div>
  337.    !endif
  338.    </div>
  339.    !if $auth_method notitemof $auth_method_list
  340.     <div class="field box">
  341.       <label for="pass">$wims_name_Password</label>
  342.       <input type="password" size="16" name="pass" id="pass" required="required"/>
  343.       <div class="formHelp">$name_passwd_warning</div>
  344.      </div>
  345.    !endif
  346.  !else
  347.     <div class="field box">
  348.      <label for="login">$wims_name_Login</label>
  349.      <input size="16" name="login" id="login" value="$login" readonly="readonly" />
  350.      <div class="formHelp">$name_internal</div>
  351.     </div>
  352.     <div class="field box">
  353.       <label for="login_ext">$wims_name_Login</label>
  354.       <input size="16" name="login_ext" id="login_ext" value="$login_ext" readonly="readonly" />
  355.       <div class="formHelp">$name_external, <span class="wims_warning"></span></div>
  356.    </div>
  357.  !endif
  358.    <div class="field box">
  359.     <label for="email">$wims_name_email</label>
  360.     <input type="email" size="60" name="email" id="email" value="$email" />
  361.     <div class="formHelp">$name_optional</div>
  362.    </div>
  363.  !if $wims_user=supervisor and $class=$wims_class and $cltype iswordof 2 4
  364.    <div class="field box">
  365.     <label for="utype">$name_accounttype</label>
  366.    !default utype=0
  367.    !set wims_ref_class=wims_formradio
  368.     !formradio utype list 0,1 prompt $wims_name_namestudent,$wims_name_nameteacher
  369.    </div>
  370.  !endif
  371.  !if $regvars_cnt>0
  372.     !read regvars.phtml
  373.  !endif
  374.  !if $wims_user!=supervisor
  375.    <div class="field box">
  376.    !set wims_ref_class=wims_formradio
  377.    !formcheckbox agreecgu list yes prompt <label for="agreecgu0">$name_cgu</label>
  378.    [
  379.   !href cmd=help $name_seecgu
  380.   ]
  381.    </div>
  382.  !endif
  383.  <div class="wimscenter wimsform"><input type="submit" value="$wims_name_tosave" /></div>
  384.  </fieldset>
  385.  
  386.  
  387. !formend
  388.  !goto end1
  389. !endif
  390.  
  391. !if $step=2
  392.  $name_hello, $name_student!<p>
  393.  $name_inscription3 <span class="tt wims_login">$login</span>. </p>
  394.  !if $email=$empty
  395.  <p> $name_passwd_nonvalid </p>
  396.  !else
  397. <p>$wims_name_email: <span class="tt wims_address">$email</span> </p>
  398.  !endif
  399.  
  400.  !form reply
  401.  <input type="hidden" name="step" value="3" />
  402.   <fieldset class="property_fields halfwidth blockcenter">
  403.   <legend>$name_title</legend>
  404.     <div class="field box">
  405.      <label for="pass2">$name_passwd_exact</label>
  406.      <input type="password" size="16" name="pass2" id="pass2" required="required" />
  407.     </div>
  408.     <div class="wimscenter wimsform">
  409.      <input type="submit" value="$wims_name_send" />
  410.     </div>
  411.   </fieldset>
  412. !formend
  413.  !goto end1
  414. !endif
  415.  
  416. !if $step=3
  417. !! needed for $name_student after !endif ?
  418.   !readproc adm/class/userdef class,$class,$login
  419.   !set firstn=!defof user_firstname in $userdef
  420.   !set lastn=!defof user_lastname in $userdef
  421.  !if $wims_user=supervisor
  422.   !set login_wims=!defof user_external_auth in $userdef
  423.   !default login_wims=$Login
  424.   $name_studentadded
  425.   <span class="tt wims_login">
  426.   !href module=adm/class/usermanage&job=userprop&getuser=$Login $login_wims
  427.   </span>.
  428.   !if $wims_supertype iswordof 2 4
  429.    !readproc adm/gateway/transfer $login test
  430.    !if $transfer_test>0
  431.     <p>
  432.     $name_otheractivities
  433.     !href module=adm/class/usermanage&job=transfer&getuser=$login $name_transfer1
  434.     </p>
  435.    !endif
  436.   !endif
  437.   !set wims_menu_items=!append line usermanage,1,module=adm/class/usermanage\
  438.  addstudent,1,module=$module&step=1\
  439.  to wims_menu_items
  440.   !goto end
  441.  !endif
  442.  <p>$name_hello, $name_student!</p>
  443.  <p>$name_welcome
  444.  <span class="tt wims_login">$login</span>. </p>
  445.  $name_youcan
  446.  !read adm/class/initclass $class,auth
  447.  
  448.  
  449.  !if $wims_class!=$empty
  450.    !if $auth_method iswordof cas
  451.      !set url = $wims_ref_name?module=adm/class/classes&type=authparticipant&class=$class
  452.      !read adm/codeurl $url
  453.      !set class_cas_auth=!getdef class_cas_auth in wimshome/log/classes/$ssclass/.def
  454.      <a class="wims_button" href="$class_cas_auth/login?service=$script_out">$wims_name_Enter</a>
  455.    !else
  456.      !if $auth_method iswordof ldap php
  457.        !set tmp=!getdef user_external_auth in wimshome/log/classes/$ssclass/.users/$login
  458.        !href module=adm/class/classes&type=authparticipant&class=$class&auth_user=$tmp $name_gotowork
  459.       !else
  460.         !href module=adm/class/classes&type=authparticipant&class=$class&auth_user=$login $name_gotowork
  461.       !endif
  462.    !endif
  463. !!FIXME what about php here
  464. !! Pourquoi est-ce different : dans le second cas ouvre une autre session, demande de nouveau le mot de passe ???
  465.  !else
  466.    !if $auth_method isitemof cas
  467.       !set url = $wims_ref_name?module=adm/class/classes&type=authparticipant&class=$class
  468.       !read adm/codeurl $url
  469.       !set class_cas_auth=!getdef class_cas_auth in wimshome/log/classes/$ssclass/.def
  470.       <a class="wims_button" href="$class_cas_auth/login?service=$script_out">$wims_name_Enter</a>
  471.    !else
  472.      !if $auth_method iswordof ldap
  473.         !set tmp=!getdef user_external_auth in wimshome/log/classes/$ssclass/.users/$login
  474.         !href module=adm/class/classes&type=authparticipant&class=$class&auth_user=$tmp $name_gotowork
  475.      !else
  476.         <a href="http://$httpd_HTTP_HOST$httpd_SCRIPT_NAME?lang=$lang&+module=adm/class/classes&+type=authparticipant&+class=$class&+auth_user=$login">
  477.  $name_gotowork</a> ($name_bookmark).
  478.      !endif
  479.    !endif
  480.  !goto end
  481.  !endif
  482. !endif
  483.  
  484. :end1
  485.  
  486. !if $wims_user=supervisor
  487.  !if $step=1
  488.  !set wims_menu_items=!append line back2,1,module=adm/class/usermanage\
  489. to $wims_menu_items
  490.  !endif
  491.  !goto end
  492. !endif
  493.  
  494. !if $cltype iswordof 2 4
  495.  !set wims_menu_items=!append line classlist,1,module=adm/class/classes&type=supervisor\
  496. to $wims_menu_items
  497. !else
  498.  !set wims_menu_items=!append line classlist,1,module=adm/class/classes&type=participant\
  499. to $wims_menu_items
  500. !endif
  501. :end
  502. !tail
  503.  
  504. !reset step, subclass
  505.  
  506.