$appob->initParams = $args;
try {
- $registry->pushApp($app, array('check_perms' => ($args['authentication'] != 'none'), 'logintasks' => !$args['nologintasks']));
+ $registry->pushApp($app, array('check_perms' => ($args['authentication'] != 'none'), 'logintasks' => !$args['nologintasks'], 'notransparent' => !empty($args['notransparent'])));
if ($args['admin'] && !$registry->isAdmin()) {
throw new Horde_Exception('Not an admin');
throw new Horde_Exception('User is not authorized', self::AUTH_FAILURE);
}
- if (!$this->hasPermission($app, Horde_Perms::READ)) {
+ if (!$this->hasPermission($app, Horde_Perms::READ, array('notransparent' => !empty($options['notransparent'])))) {
if (!$this->isAuthenticated(array('app' => $app))) {
throw new Horde_Exception('User is not authorized', self::AUTH_FAILURE);
}
*
* @return boolean Whether access is allowed.
*/
- public function hasPermission($app, $perms = Horde_Perms::READ)
+ public function hasPermission($app, $perms = Horde_Perms::READ, $params = array())
{
/* Always do isAuthenticated() check first. You can be an admin, but
* application auth != Horde admin auth. And there can *never* be
* non-SHOW access to an application that requires authentication. */
- if (!$this->isAuthenticated(array('app' => $app)) &&
+ if (!$this->isAuthenticated(array('app' => $app, 'notransparent' => !empty($params['notransparent']))) &&
$GLOBALS['injector']->getInstance('Horde_Auth')->getAuth($app)->requireAuth() &&
($perms != Horde_Perms::SHOW)) {
return false;
*/
require_once dirname(__FILE__) . '/../lib/Application.php';
-Horde_Registry::appInit('whups');
+
+if (Horde_Util::getPost('formname') == 'addcommentform') {
+ $params = array('notransparent' => true);
+} else {
+ $params = array();
+}
+Horde_Registry::appInit('whups', $params);
require_once WHUPS_BASE . '/lib/Forms/AddComment.php';