/usr/share/horde/ansel/faces/claim.php is in php-horde-ansel 3.0.5+debian0-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 | <?php
/**
* Identify a person in a photo
*
* Copyright 2008-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Duck <duck@obala.net>
*/
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('ansel');
$faces = $GLOBALS['injector']->getInstance('Ansel_Faces');
$face_id = Horde_Util::getFormData('face');
try {
$face = $faces->getFaceById($face_id);
} catch (Ansel_Exception $e) {
$notification->push($e->getMessage());
Horde::url('faces/search/all.php')->redirect();
exit;
}
$title = _("Tell us who is in this photo");
$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, $title);
$form->addHidden('', 'face', 'int', true);
$form->addVariable(_("Person"), 'person', 'text', true);
$form->setButtons($title);
if ($form->validate()) {
if (Horde_Util::getFormData('submitbutton') == _("Cancel")) {
$notification->push(_("Action was cancelled."), 'horde.warning');
} else {
$report = Ansel_Report::factory();
$gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getGallery($face['gallery_id']);
$face_link = Horde::url('faces/custom.php', true)->add(
array('name' => $vars->get('person'),
'face' => $face_id,
'image' => $face['image_id']))->setRaw(true);
$title = _("I know who is on one of your photos");
$body = _("Gallery Name") . ': ' . $gallery->get('name') . "\n"
. _("Gallery Description") . ': ' . $gallery->get('desc') . "\n\n"
. $title . "\n"
. _("Person") . ': ' . $vars->get('person') . "\n"
. _("Face") . ': ' . $face_link;
$report->setTitle($title);
try {
$result = $report->report($body, $gallery->get('owner'));
$notification->push(_("The owner of the photo, who will delegate the face name, was notified."), 'horde.success');
} catch (Ansel_Exception $e) {
$notification->push(_("Face name was not reported.") . ' ' . $e->getMessage(), 'horde.error');
}
}
Ansel_Faces::getLink($face)->redirect();
exit;
}
$page_output->header(array(
'title' => $title
));
$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, null, null, 'post');
$page_output->footer();
|