File_SMBPasswd::save()

File_SMBPasswd::save() – saves the smbpasswd file

Synopsis

mixed File_SMBPasswds:save ( )

Description

Saves the contents of File_SMBPasswd object as a corresponding smbpasswd file on the disc. Save implicitely locks the file.

Return value

mixed - Returns TRUE on success, PEAR_Error on failure.

Note

This function can not be called statically.

Example

Using File_SMBPasswd::save()

<?php
require_once('File_SMBPasswd.php');

$f = new File_SMBPasswd('./smbpasswd');
$f->load();
$ret $f->addAccount('sepp3'12'MyPw');
if (
PEAR::isError($ret)) {
    echo 
$ret->getMessage();
    exit;

$ret $f->modAccount('sepp''''MyPw');
if (
PEAR::isError($ret)) {
    echo 
$ret->getMessage();
    exit;

$ret $f->delAccount('karli');
if (
PEAR::isError($ret)) {
    echo 
$ret->getMessage();
    exit;


$status $f->save();

if (
PEAR::isError($status)) {
    
// handle errors
} else {
    
// continue processing
}

?>
unlock the smbpasswd file (Previous) prints the contents of an existing smbpasswd file (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.