~ubuntu-branches/ubuntu/quantal/gallery2/quantal

« back to all changes in this revision

Viewing changes to modules/webdav/Callbacks.inc

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2007-12-24 05:36:33 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071224053633-1ha6lnfqkfvpgdia
Tags: 2.2.4-1
* New upstream release (Urgency high due to security fixes.
  Closes: #457644)
* debian/control: 
  + Update Standards-Version (No changes needed)
  + Add Homepage field, remove Homepage from Description
* debian/rules: No longer set DH_COMPAT (use debian/compat instead)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 * @package WebDav
23
23
 * @subpackage UserInterface
24
24
 * @author Andy Staudacher <ast@gmx.ch>
25
 
 * @version $Revision: 15704 $
 
25
 * @version $Revision: 17265 $
26
26
 */
27
27
class WebDavCallbacks {
28
28
 
33
33
        case 'LoadMountLink':
34
34
            GalleryCoreApi::requireOnce('modules/webdav/classes/WebDavHelper.class');
35
35
 
36
 
            $link = WebDavHelper::getMountLink($params['itemId']);
 
36
            list ($ret, $hasPermission) =
 
37
                GalleryCoreApi::hasItemPermission($params['itemId'], 'core.view');
 
38
            if ($ret) {
 
39
                return $ret;
 
40
            }
 
41
 
 
42
            $link = array();
 
43
            if ($hasPermission) {
 
44
                $link = WebDavHelper::getMountLink($params['itemId']);
 
45
            }
37
46
 
38
47
            $block =& $smarty->_tpl_vars['block'];
39
 
            $block['webdav']['LoadMountLink'] = $link;
 
48
            $block['webdav']['LoadMountLink'] =
 
49
                array('link' => $link, 'hasPermission' => $hasPermission);
40
50
 
41
51
            return null;
42
52
        }