/[docman2]/auth/ftp.php
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 /auth/ftp.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Wed Jun 11 02:32:33 2003 UTC (20 years, 10 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
don't spit error messages

1 dpavlin 1.1 <?
2    
3     /*
4     Document manager auth_ftp.php module
5    
6     WARNING: this modules uses e-mail address to check
7     login and password against ftp server! e-mail must be
8     in following form:
9    
10     login_on_ftp_server@ftp_server.domain
11    
12     That has a side-effect that e-mail address in htusers file
13     may not be valid (if your ftp server is not e-mail server
14     also!)
15    
16     */
17    
18     function auth_ftp($user) {
19     $email = explode("@",$user[3]);
20    
21     // set up basic connection
22 dpavlin 1.2 $conn_id = @ftp_connect($email[1]);
23 dpavlin 1.1
24     if (! $conn_id) {
25     return false;
26     }
27    
28     // login with username and password
29     $login_result = @ftp_login($conn_id,$email[0],stripslashes($GLOBALS[gblPasswd]));
30    
31     if ($login_result) {
32     if (function_exists('ftp_close')) ftp_close($conn_id);
33     return true;
34     }
35     if (function_exists('ftp_close')) ftp_close($conn_id);
36     return false;
37     }
38    
39     ?>

  ViewVC Help
Powered by ViewVC 1.1.26