File_SMBPasswd::addUser() -- add a new user with the given plaintext-password. Параметр
string $user - username to be added
int $userid - userid of the user
string $pass - plaintext-password
string $comment - comment
Возвращаемое значение
mixed - Возвращает TRUE при удаче и
PEAR_Error в обратном случае.
ЗаметкаЭта функция не должна вызываться статически.
Note that the user to be added must already exist in the system password file.
ПримерПример 26-1. Using File_SMBPasswd::addUser()
<?php
require_once 'File/SMBPasswd.php';
// add user mbretter
$fh = new File_SMBPasswd('/usr/local/private/smbpasswd');
$fh->load();
$status = $fh->addUser(
'mbretter',
1004,
'MyPw',
'Michael Bretterklieber');
if (PEAR::isError($status)) {
// handle errors
} else {
// continue processing
$fh->save();
}
?>
|
|
|