\Horde_Block_Account_Localhost

Implements the Accounts API for servers with unix accounts on the localhost machine (same machine as the web server). Should work for local unix accounts, nis/nis+ accounts, or any PAM oriented accounts that appear as local accounts on the local machine. The exception is the quota support.

See that routine for additional comments.

Copyright 2002-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL-2). If you did not receive this file, see http://www.horde.org/licenses/lgpl.

Summary

Methods
Properties
Constants
__construct()
getUsername()
getQuota()
getFullname()
getHome()
getShell()
getPasswordChange()
checkPasswordStatus()
No public properties found
No constants found
_getAccount()
$_params
$_information
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_information

$_information : array

User information hash.

Type

array

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

Hash containing connection parameters.

getUsername()

getUsername() : string

Returns the username.

Returns

string —

The lowercased username.

getQuota()

getQuota() : array

Returns the user's quota for servers with a unix quota command.

This may require a modified "quota" command that allows the httpd server account to get quotas for other users... It requires that your web server and user server be the same server or at least have shared authentication and file servers (e.g. via NIS/NFS). And last, it (as written) requires the posix php extensions.

If your quota command wraps the output onto two lines, then this module will only work if you have a grep which supports the -A switch, and you append an -A1 switch to your grep_path (e.g. '/bin/grep -A1').

Throws

\Horde_Exception

if posix extension is missing.

Returns

array —

A quota array, elements are used bytes and limit bytes.

getFullname()

getFullname() : string

Returns the user's full name.

Throws

\Horde_Exception

if posix extension is missing.

Returns

string —

The user's full name.

getHome()

getHome() : string

Returns the user's home (login) directory.

Throws

\Horde_Exception

if posix extension is missing.

Returns

string —

The user's directory.

getShell()

getShell() : string

Returns the user's default shell.

Throws

\Horde_Exception

if posix extension is missing.

Returns

string —

The user's shell.

getPasswordChange()

getPasswordChange() : string

Returns the date of the user's last password change.

Returns

string —

Date string.

checkPasswordStatus()

checkPasswordStatus() : string

Returns the status of the current password.

Returns

string —

A string with a warning message if the password is about to expire.

_getAccount()

_getAccount() : array

Returns the user account from the posix information.

Throws

\Horde_Exception

if posix extension is missing.

Returns

array —

A hash with complete account details.