58 lines
1.7 KiB
Plaintext
58 lines
1.7 KiB
Plaintext
|
#!/usr/bin/perl
|
||
|
# passwd.cgi
|
||
|
# ... Servicios de Tarantella.
|
||
|
|
||
|
require './tarantella-lib.pl';
|
||
|
do "ldap-lib.pl";
|
||
|
&ReadParse();
|
||
|
|
||
|
$dn = $in{dn};
|
||
|
if (!$dn) { &redirect("tta_selusr.cgi?form=passwd"); }
|
||
|
$username=$in{username};
|
||
|
$password=$in{password};
|
||
|
if (!$password) { &redirect("tta_selusr.cgi?form=passwd"); }
|
||
|
&header($text{'index_passwd'}, "", "");
|
||
|
print "<hr><p>\n";
|
||
|
print "<p>\n";
|
||
|
print "<table width=100% border>\n";
|
||
|
|
||
|
$organizationname="";
|
||
|
$ens_ou="";
|
||
|
foreach $ou (&list_ous()) {
|
||
|
if ( $ou->{'alias'} eq $in{userou}) {
|
||
|
$ens_ou=$ou->{ens};
|
||
|
$organizationname=$ou->{name};
|
||
|
last;
|
||
|
}
|
||
|
}
|
||
|
print "<tr $tb> <td><b>".&text('titidx_passwd',$username,$organizationname)."</b></td> </tr>\n";
|
||
|
print "<tr $cb> <td><table width=100%>\n";
|
||
|
print "<center>\n";
|
||
|
|
||
|
$ldap_server=1;
|
||
|
&connect ();
|
||
|
|
||
|
if ( &mod_usr_password() eq 0 ) {
|
||
|
if ( $config{ldap2_server}.length gt 0 ) {
|
||
|
$ldap_server=2;
|
||
|
&connect ();
|
||
|
if ( &mod_usr_password() ne 0 ) { &err_replication() }
|
||
|
}
|
||
|
$lin_user="mod::".$username."::".$password."::".$surname."::".$dn;
|
||
|
&lock_file($config{'ldap_log'});
|
||
|
open(FILELDAPLOG, ">>$config{'ldap_log'}");
|
||
|
print FILELDAPLOG "$lin_user\n";
|
||
|
close (FILELDAPLOG);
|
||
|
$str=$text{'user_update'}.$username." ($surname) -> ".$dn;
|
||
|
&additional_log('passwd.cgi', undef, $str);
|
||
|
&webmin_log($config{'ldap_log'}, undef, "modify");
|
||
|
&unlock_file($config{'ldap_log'});
|
||
|
print "</pre><tr><p><b>$text{'user_update'}... LDAP </b></tr>\n";
|
||
|
}
|
||
|
print "<tr></tr>\n";
|
||
|
print "<tr><tr></table></table><hr><p>\n";
|
||
|
&footer($config{'back_return'},$text{'index'});
|
||
|
print "<p><p><p>\n";
|
||
|
do "footer.pl";
|
||
|
exit;
|