/usr/share/horde/turba/lib/View/DeleteContact.php is in php-horde-turba 4.1.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 71 72 73 74 75 | <?php
/**
* The Turba_View_DeleteContact:: class provides an API for viewing events.
* @TODO: Refactor to a Horde_View
*
* @author Chuck Hagenbuch <chuck@horde.org>
* @package Turba
*/
class Turba_View_DeleteContact
{
/**
* @var Turba_Object
*
*/
public $contact;
/**
* @param Turba_Object $contact
*/
public function __construct(Turba_Object $contact)
{
$this->contact = $contact;
}
public function getTitle()
{
return $this->contact
? sprintf($this->contact->isGroup() ? _("Delete Group \"%s\"") : _("Delete \"%s\""), $this->contact->getValue('name'))
: _("Not Found");
}
public function html($active = true)
{
if (!$this->contact) {
echo '<h3>' . _("The requested contact was not found.") . '</h3>';
return;
}
if (!$this->contact->hasPermission(Horde_Perms::DELETE)) {
if (!$this->contact->hasPermission(Horde_Perms::READ)) {
echo '<h3>' . _("You do not have permission to view this contact.") . '</h3>';
return;
} else {
echo '<h3>' . _("You only have permission to view this contact.") . '</h3>';
return;
}
}
echo '<div id="DeleteContact"' . ($active ? '' : ' style="display:none"') . '>';
?>
<form action="<?php echo Horde::url('delete.php') ?>" method="post">
<?php echo Horde_Util::formInput() ?>
<input type="hidden" name="url" value="<?php echo htmlspecialchars(Horde_Util::getFormData('url')) ?>" />
<input type="hidden" name="source" value="<?php echo htmlspecialchars($this->contact->driver->getName()) ?>" />
<input type="hidden" name="key" value="<?php echo htmlspecialchars($this->contact->getValue('__key')) ?>" />
<div class="headerbox" style="padding: 8px">
<p><?php echo _("Permanently delete this contact?") ?></p>
<input type="submit" class="horde-delete" name="delete" value="<?php echo _("Delete") ?>" />
</div>
</form>
</div>
<?php
if ($active && $GLOBALS['browser']->hasFeature('dom')) {
if ($this->contact->hasPermission(Horde_Perms::READ)) {
$view = new Turba_View_Contact($this->contact);
$view->html(false);
}
if ($this->contact->hasPermission(Horde_Perms::EDIT)) {
$delete = new Turba_View_EditContact($this->contact);
$delete->html(false);
}
}
}
}
|