122 lines
6.0 KiB
Perl
Executable File
122 lines
6.0 KiB
Perl
Executable File
#!/usr/bin/perl
|
|
# tta_passwdcache.cgi
|
|
# Change Tarantella User Paswords
|
|
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo --- license GNU GPL
|
|
# stta: (@#) 1.31051043346- [2004_01_29_102036]
|
|
|
|
require './stta-lib.pl';
|
|
&ReadParse();
|
|
|
|
$dn = $in{dn};
|
|
if (!$dn) { &redirect("tta_selusr.cgi?form=passwdcache"); }
|
|
$username = $in{username};
|
|
&headerstta($text{'index_passwdcache'}, "", "passwdcache",undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );
|
|
print "<hr><p>\n";
|
|
print "<SCRIPT SRC=\"global.js\">\n";
|
|
print "</SCRIPT>\n";
|
|
print "<SCRIPT LANGUAGE=\"JavaScript\">\n";
|
|
print "<!--\n";
|
|
print "/* Strings for locales */\n";
|
|
print "var msg0=\"".$text{'msg_0'},"\";\n";
|
|
print "var msg1=\"".$text{'msg_1'},"\";\n";
|
|
print "var msg2=\"".$text{'msg_2'},"\";\n";
|
|
print "var msg3=\"".$text{'msg_3'},"\";\n";
|
|
print "var msg4=\"".$text{'msg_4'},"\";\n";
|
|
print "var msg5=\"".$text{'msg_5'},"\";\n";
|
|
print "var msg6=\"".$text{'msg_6'},"\";\n";
|
|
print "var msg7=\"".$text{'msg_7'},"\";\n";
|
|
print "var ask_confadmin=true;\n";
|
|
print "/******************************************************************\n";
|
|
print " setPasswdDefault(formObj)\n";
|
|
print " If password is empty assign username as default value in the form.\n";
|
|
print "*******************************************************************/\n";
|
|
print "function setPasswdDefault(formObj) {\n";
|
|
print " if (emptyField(formObj.username)) {\n";
|
|
print " formObj.username.value=\"\";\n";
|
|
print " formObj.password.value=\"\";\n";
|
|
print " return\n";
|
|
print " } \n";
|
|
print " username=StringClip(true,formObj.username.value);\n";
|
|
print " formObj.username.value=username;\n";
|
|
print " if (emptyField(formObj.password)) {\n";
|
|
print " formObj.password.value=username;\n";
|
|
print " setStatusBar(msg0);\n";
|
|
print " }\n";
|
|
print "}\n";
|
|
print "/******************************************************************\n";
|
|
print " showPasswd(formObj)\n";
|
|
print " Show Password value from form.\n";
|
|
print "*******************************************************************/\n";
|
|
print "function showPasswd(formObj) {\n";
|
|
print " alert(\"Password es:\"+formObj.password.value+\"\");\n";
|
|
print "}\n";
|
|
print "/******************************************************************\n";
|
|
print " Check_fields(obj)\n";
|
|
print "*******************************************************************/\n";
|
|
print "function Check_fields(obj) {\n";
|
|
print " if ( emptyField(obj.username) == true ) {\n";
|
|
print " alert(obj.username.name+\":\"+msg1+\"->\"+obj.username.value+\"<-\");\n";
|
|
print " obj.username.focus();\n";
|
|
print " return false;\n";
|
|
print " } \n";
|
|
print " if ( emptyField(obj.username3) == true ) {\n";
|
|
print " alert(obj.username3.name+\":\"+msg1+\"->\"+obj.username3.value+\"<-\");\n";
|
|
print " obj.username3.focus();\n";
|
|
print " return false;\n";
|
|
print " if ( emptyField(obj.password) == true ) {\n";
|
|
print " alert(obj.password.name+\":\"+msg1+\"->\"+obj.password.value+\"<-\");\n";
|
|
print " obj.password.focus();\n";
|
|
print " return false;\n";
|
|
print " } \n";
|
|
print " if ( get_value(\"select\",obj.passwObj) == \"none\" ) {\n";
|
|
print " alert(obj.passwObj.name+\":\"+msg1);\n";
|
|
print " obj.passwObj.focus();\n";
|
|
print " return false;\n";
|
|
print " } \n";
|
|
print " return true;\n";
|
|
print "}\n";
|
|
print "//-->\n";
|
|
print "</SCRIPT>\n";
|
|
print "\n";
|
|
print "<table width=100% border>\n";
|
|
print "<tr $tb> <td><font color='$revtext'><b>$text{'titidx_passwdcache'}-- $username</b></td> </tr>\n";
|
|
print "<tr $cb> <td><table align=left>\n";
|
|
print "<form METHOD=POST name=newUser ACTION=\"passwdcache.cgi\" onSubmit=\"return Check_fields(this)\">\n";
|
|
print " <tr><td valign=top>",&hlink("<b>$text{'f_username'}</b>","fusername")," ",$in{'username'}," ";
|
|
print " ",&hlink("<b>$text{'f_grupo'}</b>","fgrupo")," ",$in{'userou'} ,"\n";
|
|
print " <input TYPE=\"hidden\" NAME=\"username\" VALUE=\"",$in{'username'},"\">\n";
|
|
print " <input TYPE=\"hidden\" NAME=\"dn\" VALUE=\"",$in{'dn'},"\">\n";
|
|
print " <input TYPE=\"hidden\" NAME=\"userou\" VALUE=\"",$in{'userou'},"\">\n";
|
|
#print " <input TYPE=\"text\" NAME=\"username\" VALUE=\"\" cols=\"22\" size=\"12\" ALIGN=left\n";
|
|
#print " onChange=\"setPasswdDefault(newUser)\" onFocus=\"setPasswdDefault(newUser)\" ></tr></td>\n";
|
|
print " <tr><td valign=top>",&hlink("<b>$text{'f_username3'}</b>","fusername3")," ";
|
|
print " <input TYPE=\"text\" NAME=\"username3\" VALUE=\"\" cols=\"22\" size=\"12\" ALIGN=left\n";
|
|
print " ></tr></td>\n";
|
|
print " <tr><td valign=top>",&hlink("<b>$text{'f_password'}</b>","fpassword"),"\n";
|
|
print " <input TYPE=\"button\" NAME=\"?\" VALUE=\"?\" onClick=\"showPasswd(newUser);\" >\n";
|
|
print " <input TYPE=\"password\" NAME=\"password\" VALUE=\"\" cols=\"22\" size=\"12\" ALIGN=left\n";
|
|
print " onChange=\"setPasswdDefault(newUser)\" onFocus=\"setPasswdDefault(newUser)\" ></tr></td>\n";
|
|
print " <tr><td valign=top>",&hlink("<b>$text{'f_obj'}</b>","fobj")," \n";
|
|
print " <td valign=top><select NAME=\"obj\">\n";
|
|
print " <option VALUE=\"none\">",&hlink("<b>$text{'f_selobj'}</b>","fselobj"),"\n";
|
|
$nItems=0;
|
|
%h_link=&list_links();
|
|
foreach $item (keys (%h_link)) {
|
|
print " <option VALUE=\"".$h_link{$item}->{'alias'}."\">". $h_link{$item}->{'name'}."\n";
|
|
$nItems++;
|
|
}
|
|
print " </select></tr></td>\n";
|
|
print " <tr><td valign=top><input TYPE=\"submit\" NAME=\"",$text{'f_sendreq'},"\" VALUE=\"",$text{'f_sendreq'},"\">\n";
|
|
print " </td>\n";
|
|
print " <td valign=top><input TYPE=\"reset\" NAME=\"",$text{'f_cancelreq'},"\" VALUE=\"",$text{'f_cancelreq'},"\"></td></tr>\n";
|
|
|
|
print " </form>\n";
|
|
print "<tr><tr></table></table><hr><p>\n";
|
|
&footer($config{'back_return'},$text{'index'});
|
|
print "<p><p><p>\n";
|
|
do "footer.pl\n";
|
|
exit;
|
|
|
|
|
|
|