1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
<?php
/**
* Null Turba directory driver.
*
* $Horde: turba/lib/Driver/null.php,v 1.2.2.1 2005/11/10 00:02:40 mdjukic Exp $
*
* @author Marko Djukic <mdjukic@horde.org>
* @since Turba 2.2
* @package Turba
*/
class Turba_Driver_null extends Turba_Driver {
/**
* Whether this source has a readonly driver.
*
* @var boolean
*/
var $readonly = true;
/**
*
*/
function _init()
{
return true;
}
/**
* Checks if the current user has the requested permissions on this
* source.
*
* @param integer $perm The permission to check for.
*
* @return boolean True if the user has permission, otherwise false.
*/
function hasPermission($perm)
{
switch ($perm) {
case PERMS_EDIT: return false;
case PERMS_DELETE: return false;
default: return true;
}
}
function _search()
{
return PEAR::raiseError(_("Searching is not available."));
}
function _read()
{
return PEAR::raiseError(_("Reading contacts is not available."));
}
function _add($attributes)
{
return PEAR::raiseError(_("Adding contacts is not available."));
}
function _delete($object_key, $object_id)
{
return PEAR::raiseError(_("Deleting contacts is not available."));
}
function _save($object_key, $object_id, $attributes)
{
return PEAR::raiseError(_("Saving contacts is not available."));
}
}
|