/[informatika.old]/html/inc/poppassd.inc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /html/inc/poppassd.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Wed Oct 3 15:18:08 2001 UTC (22 years, 7 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
promjena lozinke na serveru

1 dpavlin 1.1 <?
2    
3     // poppassd -- change password
4    
5     // input: login, password, new password
6     // returns: array ( return code, message )
7    
8    
9     function poppassd($login,$passwd,$newpasswd) {
10    
11     function gronk($fp,$command) {
12     fputs($fp,"$command\r\n");
13     $line=fgets($fp,255);
14     if (substr($line,0,3) == "200") {
15     return(array(1,$line));
16     } else {
17     return(array(0,$line));
18     }
19     }
20    
21     $host="intranet.pliva.hr";
22    
23     $fp = fsockopen($host, 106, &$errno, &$errstr, 30);
24     if(!$fp) {
25     return(array(0,"can't connect to $host port 106"));
26     } else {
27     $line=fgets($fp,255); # skip welcome
28     $out=gronk($fp,"user $login");
29     if (! $out[0]) return($out);
30     $out=gronk($fp,"pass $passwd");
31     if (! $out[0]) return($out);
32     $out=gronk($fp,"newpass $newpasswd");
33     fclose($fp);
34     }
35    
36     return($out);
37    
38     }
39    
40     ?>

  ViewVC Help
Powered by ViewVC 1.1.26