Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F9892567
poppassd.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
poppassd.php
View Options
<?php
/**
* Poppassd Password Driver
*
* Driver to change passwords via Poppassd/Courierpassd
*
* @version 1.0
* @author Philip Weir
*
*/
function
password_save
(
$curpass
,
$passwd
)
{
$rcmail
=
rcmail
::
get_instance
();
// include('Net/Socket.php');
$poppassd
=
new
Net_Socket
();
if
(
PEAR
::
isError
(
$poppassd
->
connect
(
$rcmail
->
config
->
get
(
'password_pop_host'
),
$rcmail
->
config
->
get
(
'password_pop_port'
),
null
)))
{
return
PASSWORD_CONNECT_ERROR
;
}
else
{
$result
=
$poppassd
->
readLine
();
if
(!
preg_match
(
'/^2
\d\d
/'
,
$result
))
{
$poppassd
->
disconnect
();
return
PASSWORD_ERROR
;
}
else
{
$poppassd
->
writeLine
(
"user "
.
$_SESSION
[
'username'
]);
$result
=
$poppassd
->
readLine
();
if
(!
preg_match
(
'/^[23]
\d\d
/'
,
$result
)
)
{
$poppassd
->
disconnect
();
return
PASSWORD_CONNECT_ERROR
;
}
else
{
$poppassd
->
writeLine
(
"pass "
.
$curpass
);
$result
=
$poppassd
->
readLine
();
if
(!
preg_match
(
'/^[23]
\d\d
/'
,
$result
)
)
{
$poppassd
->
disconnect
();
return
PASSWORD_ERROR
;
}
else
{
$poppassd
->
writeLine
(
"newpass "
.
$passwd
);
$result
=
$poppassd
->
readLine
();
$poppassd
->
disconnect
();
if
(!
preg_match
(
'/^2
\d\d
/'
,
$result
))
return
PASSWORD_ERROR
;
else
return
PASSWORD_SUCCESS
;
}
}
}
}
}
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Aug 21, 3:04 AM (9 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1260419
Default Alt Text
poppassd.php (1 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment