Subversion Repositories wimsdev

Rev

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