PEAR Manual
This manual is provided as a courtesy. It is not an official source. Please check pear.php.net for updated information.
mixed File_SMBPasswds:save ()
mixed File_SMBPasswds:save
Saves the contents of File_SMBPasswd object as a corresponding smbpasswd file on the disc. Save implicitely locks the file.
mixed - Returns TRUE on success, PEAR_Error on failure.
This function can not be called statically.
Example 38-1. 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 } ?>