/[docman]/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

Contents of /auth_ftp.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Tue Feb 19 14:01:35 2002 UTC (22 years, 1 month ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
verify users using ftp server (user verification is no longer dependent on
size of inbox on pop3 server)

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 $conn_id = ftp_connect($email[1]);
23
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[PHP_AUTH_PW]));
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