Perms:: -> Horde_Perms::
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 22 Nov 2009 18:02:02 +0000 (11:02 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Sun, 22 Nov 2009 18:09:40 +0000 (11:09 -0700)
209 files changed:
ApertureToAnselExportPlugin/TURAnselKit/TURAnsel.h
ApertureToAnselExportPlugin/TURAnselKit/TURAnsel.m
ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.m
ansel/edit_dates.php
ansel/faces/custom.php
ansel/faces/delete.php
ansel/faces/gallery.php
ansel/faces/name.php
ansel/gallery.php
ansel/gallery/captions.php
ansel/gallery/delete.php
ansel/gallery/sort.php
ansel/group.php
ansel/image.php
ansel/img/download.php
ansel/img/full.php
ansel/img/index.php
ansel/img/mini.php
ansel/img/prettythumb.php
ansel/img/screen.php
ansel/img/thumb.php
ansel/img/upload_preview.php
ansel/js/googlemap.js
ansel/lib/Ajax/Imple/EditCaption.php
ansel/lib/Ajax/Imple/EditFaces.php
ansel/lib/Ajax/Imple/ImageSaveGeotag.php
ansel/lib/Ajax/Imple/TagActions.php
ansel/lib/Ansel.php
ansel/lib/Api.php
ansel/lib/Block/gallery.php
ansel/lib/Block/my_galleries.php
ansel/lib/Block/recent_comments.php
ansel/lib/Block/recently_added.php
ansel/lib/Block/recently_added_geodata.php
ansel/lib/Faces/Base.php
ansel/lib/Gallery.php
ansel/lib/GalleryMode/Date.php
ansel/lib/GalleryMode/Normal.php
ansel/lib/Image.php
ansel/lib/ImageView.php
ansel/lib/Storage.php
ansel/lib/Tags.php
ansel/lib/Tile/DateGallery.php
ansel/lib/Tile/Gallery.php
ansel/lib/Tile/Image.php
ansel/lib/View/Base.php
ansel/lib/View/EmbeddedRenderer/GalleryLink.php
ansel/lib/View/EmbeddedRenderer/Mini.php
ansel/lib/View/Gallery.php
ansel/lib/View/GalleryRenderer/Base.php
ansel/lib/View/GalleryRenderer/Gallery.php
ansel/lib/View/GalleryRenderer/GalleryLightbox.php
ansel/lib/View/Image.php
ansel/lib/View/List.php
ansel/lib/View/Results.php
ansel/lib/Widget/Actions.php
ansel/lib/Widget/GalleryFaces.php
ansel/lib/Widget/Geotag.php
ansel/lib/Widget/ImageFaces.php
ansel/lib/Widget/OtherGalleries.php
ansel/lib/Widget/Tags.php
ansel/map_edit.php
ansel/perms.php
ansel/preview.php
ansel/rss.php
ansel/scripts/ansel.php
ansel/scripts/recursive_import.php
ansel/scripts/remote_import.php
ansel/templates/gallery/gallery.inc
ansel/templates/group/category.inc
ansel/templates/group/owner.inc
ansel/templates/image/preview_cropimage.inc
ansel/templates/image/preview_image.inc
ansel/templates/view/gallery.inc
ansel/templates/view/gallerylightbox.inc
ansel/templates/view/image.inc
ansel/templates/view/results.inc
ansel/templates/view/slideshow.inc
ansel/templates/xppublish/list.inc
ansel/xppublish.php
babel/view.php
beatnik/lib/Beatnik.php
beatnik/lib/Driver.php
chora/lib/Chora.php
fima/account.php
fima/accounts.php
fima/lib/Fima.php
fima/postings.php
fima/templates/accounts/accounts.inc
folks/config/hooks.php.dist
folks/lib/Driver.php
folks/lib/Friends/shared.php
folks/lib/Notification.php
folks/perms.php
framework/Service_Facebook/lib/Horde/Service/Facebook/Auth.php
gollem/lib/Api.php
gollem/lib/Block/tree_menu.php
gollem/lib/Gollem.php
gollem/manager.php
gollem/selectlist.php
imp/index-dimp.php
imp/lib/IMP.php
imp/lib/Message.php
imp/saveimage.php
ingo/filters.php
ingo/lib/Application.php
ingo/lib/Ingo.php
ingo/lib/base.php
ingo/rule.php
kastalia/main.php
koward/lib/Koward.php
kronolith/add.php
kronolith/ajax.php
kronolith/data.php
kronolith/delete.php
kronolith/docs/CHANGES
kronolith/edit.php
kronolith/feed/index.php
kronolith/lib/Ajax/Imple/TagActions.php
kronolith/lib/Api.php
kronolith/lib/Block/month.php
kronolith/lib/Block/monthlist.php
kronolith/lib/Block/prevmonthlist.php
kronolith/lib/Block/summary.php
kronolith/lib/Driver/Kolab.php
kronolith/lib/Driver/Resource.php
kronolith/lib/Driver/Sql.php
kronolith/lib/Event.php
kronolith/lib/Forms/CreateResource.php
kronolith/lib/Forms/CreateResourceGroup.php
kronolith/lib/Forms/DeleteResource.php
kronolith/lib/Forms/DeleteResourceGroup.php
kronolith/lib/Forms/EditResource.php
kronolith/lib/Forms/EditResourceGroup.php
kronolith/lib/Kronolith.php
kronolith/lib/LoginTasks/Task/PurgeEvents.php
kronolith/lib/Resource/Base.php
kronolith/lib/View/Day.php
kronolith/lib/View/DeleteEvent.php
kronolith/lib/View/EditEvent.php
kronolith/lib/View/Event.php
kronolith/lib/View/Month.php
kronolith/new.php
kronolith/perms.php
kronolith/resources/delete.php
kronolith/resources/edit.php
kronolith/resources/groups/delete.php
kronolith/resources/groups/edit.php
kronolith/resources/groups/index.php
kronolith/resources/index.php
kronolith/scripts/agenda.php
kronolith/scripts/import_squirrelmail_calendar.php
kronolith/search.php
kronolith/templates/data/export.inc
kronolith/templates/data/import.inc
kronolith/templates/edit/edit.inc
kronolith/templates/panel.inc
kronolith/templates/perms/perms.inc
kronolith/templates/week/head.inc
nag/ics.php
nag/lib/Api.php
nag/lib/Block/summary.php
nag/lib/Driver.php
nag/lib/Forms/task.php
nag/lib/Nag.php
nag/task.php
nag/templates/data/export.inc
nag/templates/data/import.inc
nag/templates/list/task_summaries.inc
nag/templates/view/task.inc
nag/view.php
news/add.php
news/edit.php
news/lib/Api.php
news/lib/Categories.php
news/lib/Driver/sql.php
news/lib/Forms/Search.php
news/lib/News.php
news/lib/Search.php
skoli/add.php
skoli/classes/delete.php
skoli/classes/edit.php
skoli/entry.php
skoli/lib/Block/tree_menu.php
skoli/lib/Forms/Entry.php
skoli/lib/Skoli.php
skoli/list.php
turba/contact.php
turba/data.php
turba/edit.php
turba/lib/Api.php
turba/lib/Application.php
turba/lib/Driver.php
turba/lib/Driver/Facebook.php
turba/lib/Driver/Favourites.php
turba/lib/Driver/Group.php
turba/lib/Driver/Imsp.php
turba/lib/ListView.php
turba/lib/Object.php
turba/lib/Turba.php
turba/lib/View/Contact.php
turba/lib/View/DeleteContact.php
turba/lib/View/EditContact.php
turba/lib/base.php
turba/scripts/upgrades/public_to_horde_share.php
turba/templates/browse/row.inc
turba/vcard.php
turba/view.php
vilma/lib/Vilma.php

index 68aed5c..a3ffb8c 100644 (file)
@@ -2,7 +2,7 @@
  * TURAnsel
  *
  * Copyright 2009 The Horde Project (http://www.horde.org)
- * 
+ *
  * @license http://opensource.org/licenses/bsd-license.php
  * @author  Michael J. Rubinsky <mrubinsk@horde.org>
  */
@@ -33,7 +33,7 @@ typedef enum {
 @interface TURAnsel : NSObject <NSComboBoxDataSource>
 #else
 @interface TURAnsel : NSObject
-#endif         
+#endif
 {
     NSString *userAgent;
     NSString *rpcEndPoint;
index 347d564..6c752f9 100644 (file)
@@ -4,7 +4,7 @@
  * Main class for interacting with a remote Ansel server.
  *
  * Copyright 2009 The Horde Project (http://www.horde.org)
- * 
+ *
  * @license http://opensource.org/licenses/bsd-license.php
  * @author  Michael J. Rubinsky <mrubinsk@horde.org>
  */
@@ -27,9 +27,9 @@
 {
     [super init];
     galleryList = [[NSMutableArray alloc] init];
-    
+
     // Initialize the connection properties, KVC style
-    [self setValue:[params objectForKey:@"endpoint"] 
+    [self setValue:[params objectForKey:@"endpoint"]
             forKey: @"rpcEndPoint"];
     [self setValue: [params objectForKey:@"username"]
             forKey: @"username"];
             forKey: @"password"];
     [self setValue: @"The Ansel Cocoa XML-RPC Client"
             forKey: @"userAgent"];
-    
+
     return self;
 }
 -(void) dealloc
 {
-    NSLog(@"TURAnsel dealloc");   
+    NSLog(@"TURAnsel dealloc");
     [galleryList removeAllObjects];
     [galleryList release];
     [rpcEndPoint release];
@@ -54,7 +54,7 @@
 
 #pragma mark -
 #pragma mark Actions
-- (void)connect 
+- (void)connect
 {
     [self doLogin];
 }
  */
 - (NSDictionary *)createNewGallery: (NSDictionary *)params
 {
-    NSArray *apiparams = [NSArray arrayWithObjects: @"ansel", params, nil]; 
+    NSArray *apiparams = [NSArray arrayWithObjects: @"ansel", params, nil];
     NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope, kTURAnselAPIParamGaleryParams, nil];
-    
+
     NSDictionary *response = [self callRPCMethod: @"images.createGallery"
                                       withParams: apiparams
                                        withOrder: order];
-    
+
     if (response) {
-        NSNumber *gallery_id = [response objectForKey: (NSString *)kWSMethodInvocationResult];    
+        NSNumber *gallery_id = [response objectForKey: (NSString *)kWSMethodInvocationResult];
         NSDictionary *results = [NSDictionary dictionaryWithObjectsAndKeys:
                                  gallery_id, kTURAnselGalleryKeyId,
                                  [params valueForKey: @"name"], kTURAnselGalleryKeyName,
                                  @"", kTURAnselGalleryKeyDescription,
                                  [NSNumber numberWithInt: 0], kTURAnselGalleryKeyImages,
                                  [NSNumber numberWithInt: 0], kTURAnselGalleryKeyDefaultImage, nil];
-        
+
         TURAnselGallery *newGallery = [[TURAnselGallery alloc] initWithObject: results
                                                                    controller: self];
         [galleryList addObject: newGallery];
         [newGallery release];
-        
+
         return results;
     }
-    
+
     return nil;
 }
 
 
 /**
- * Entry point for calling RPC methods on the Horde server. 
- * 
+ * Entry point for calling RPC methods on the Horde server.
+ *
  * @param NSString methodName  The method to call (e.g. images.listGalleries)
  * @param NSArray  params      All the method's parameters
  * @param NSArray  order       Keys for the params array, needed because of how
                       withOrder: (NSArray *) order
 {
     NSLog(@"Initiating connection for %@", methodName);
-    
+
     // Get a URL object
     NSURL *url = [NSURL URLWithString: [self valueForKey: @"rpcEndPoint"]];
     NSDictionary *values = [NSDictionary dictionaryWithObjects: params forKeys:order];
-    
+
     // Credentials
     NSString *user = [self valueForKey:@"username"];
     NSString *pass = [self valueForKey:@"password"];
-    
+
     if (user != nil && [user length] && pass != nil && [pass length]) {
         // Create a custom http request with authorization
         CFHTTPMessageRef request = CFHTTPMessageCreateRequest(kCFAllocatorDefault,
                                                          (CFStringRef)pass,
                                                          kCFHTTPAuthenticationSchemeBasic,
                                                          false);
-        
+
         NSLog(@"Results adding credentials to request: %d", success);
         if (!success) {
             NSLog(@"Unable to authenticate");
-            
+
             if ([[self delegate] respondsToSelector: @selector(TURAnselHadError:)]) {
                 NSError *error = [NSError errorWithDomain:@"TURAnsel"
                                                      code: 1
                                                  userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Authentication failure.", @"message", nil]];
-                
+
                 [[self delegate] TURAnselHadError: error];
             }
-            
+
             return nil;
-            
+
         } else {
             // Build a new invocation
             [self setState:TURAnselStateWaiting];
             WSMethodInvocationRef rpcCall;
-            rpcCall = WSMethodInvocationCreate((CFURLRef)url, (CFStringRef)methodName, kWSXMLRPCProtocol); 
+            rpcCall = WSMethodInvocationCreate((CFURLRef)url, (CFStringRef)methodName, kWSXMLRPCProtocol);
             WSMethodInvocationSetParameters(rpcCall, (CFDictionaryRef)values, (CFArrayRef)order);
             WSMethodInvocationSetProperty(rpcCall, kWSHTTPMessage, request);
             NSDictionary *result = (NSDictionary *)WSMethodInvocationInvoke(rpcCall);
                         error = [NSError errorWithDomain: @"TURAnsel"
                                                     code: [faultCode intValue]
                                                 userInfo: [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat: @"There was an error contacting the Ansel server: %@, %@", resStatusLine, faultString], @"NSLocalizedDescriptionKey", nil]];
-                        
-                        
-                    } 
+
+
+                    }
                     [resStatusLine release];
                 } else {
                     // No response
                                             userInfo: [NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithFormat: @"There was an error contacting the Ansel server: %@", faultString], @"NSLocalizedDescriptionKey", nil]];
 
                 }
-                
+
                 if ([[self delegate] respondsToSelector: @selector(TURAnselHadError:)]) {
                     [[self delegate] TURAnselHadError: error];
                 }
                 [result autorelease];
                 return nil;
-                
+
             }
             CFHTTPMessageRef response = (CFHTTPMessageRef)[result objectForKey:(id)kWSHTTPResponseMessage];
             int resStatusCode = CFHTTPMessageGetResponseStatusCode(response);
             NSLog(@"ResponseCode: %d", resStatusCode);
             [self setState:TURAnselStateConnected];
             return [result autorelease];
-        }       
+        }
     }
-    
+
     NSLog(@"No authentication information present.");
     return nil;
-    
+
 }
 
 #pragma mark -
             return g;
         }
     }
-    
+
     return nil;
 }
 
 }
 
 - (id)delegate {
-    return delegate;    
+    return delegate;
 }
 
 - (void)setDelegate:(id)newDelegate {
 - (void)doLogin
 {
     NSArray *params = [[NSArray alloc] initWithObjects:
-                       @"ansel",                                 // Scope 
+                       @"ansel",                                 // Scope
                        [NSNumber numberWithInt: PERMS_EDIT],     // Perms
                        @"",                                      // No parent
                        [NSNumber numberWithBool:YES],            // allLevels
                        [NSNumber numberWithInt: 0],              // Offset
                        [NSNumber numberWithInt: 0],              // Count
                        [self valueForKey:@"username"], nil];     // Restrict to user (This should be an option eventually).
-    
+
     NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope, kTURAnselAPIParamPerms,
                                                 kTURAnselAPIParamParent, kTURAnselAPIParamAllLevels,
                                                 kTURAnselAPIParamOffset, kTURAnselAPIParamCount,
                                                 kTURAnselAPIParamUserOnly, nil];
-    
+
     NSDictionary *results = [self callRPCMethod: @"images.listGalleries"
                                      withParams: params
                                       withOrder: order];
-    
+
     if (results) {
         NSDictionary *galleries = [results objectForKey: (id)kWSMethodInvocationResult];
         for (NSString *gal in galleries) {
             [theGallery release];
             theGallery = nil;
         }
-        
+
         if ([delegate respondsToSelector:@selector(TURAnselDidInitialize)]) {
             [delegate performSelectorOnMainThread:@selector(TURAnselDidInitialize)
                                        withObject:self
                                     waitUntilDone: NO];
         }
-        
+
     }
-    
+
     [params release];
 }
-@end
\ No newline at end of file
+@end
index a081a64..b2dcab2 100644 (file)
@@ -2,7 +2,7 @@
  * TURAnselGallery.m
  *
  * Copyright 2009 The Horde Project (http://www.horde.org)
- * 
+ *
  * @license http://opensource.org/licenses/bsd-license.php
  * @author  Michael J. Rubinsky <mrubinsk@horde.org>
  */
@@ -35,7 +35,7 @@
     [self setValue:[galleryData valueForKey: kTURAnselGalleryKeyName]
             forKey:@"galleryName"];
     [self setValue: [galleryData valueForKey: kTURAnselGalleryKeyImages]
-            forKey:@"galleryImageCount"];    
+            forKey:@"galleryImageCount"];
     [self setValue: [galleryData valueForKey: kTURAnselGalleryKeyDefaultImage]
             forKey:@"galleryKeyImage"];
     [self setAnselController: controller];
     NSLog(@"TURAnselGallery dealloc called on Gallery %@", self);
     [anselController release];
     anselController = nil;
-    
+
     [galleryKeyImageURL release];
     galleryKeyImageURL = nil;
-    
+
     [imageList release];
     imageList = nil;
-    
+
     [super dealloc];
 }
-- (id)description 
+- (id)description
 {
     NSString *text = [NSString stringWithFormat:@"Description: %@ Id: %d has: %d images", galleryName, _galleryId, galleryImageCount];
     return text;
@@ -66,7 +66,7 @@
 /**
  * Requests the gallery's key image url to be fetched from the server
  * (This information is not present in the gallery definition array returned
- *  from the images.listGalleries call). 
+ *  from the images.listGalleries call).
  */
 - (NSURL *)galleryKeyImageURL
 {
                                                     kTURAnselAPIParamImageId,
                                                     kTURAnselAPIParamThumbnailStyle,
                                                     kTURAnselAPIParamFullPath, nil];
-        
+
         NSDictionary *response = [anselController callRPCMethod: @"images.getImageUrl"
                                                        withParams: params
                                                         withOrder: order];
-        
+
         if (response) {
             NSDictionary *url = [response objectForKey:(id)kWSMethodInvocationResult];
             [galleryKeyImageURL autorelease];
             galleryKeyImageURL = [[NSURL URLWithString: [NSString stringWithFormat: @"%@", url]] retain];
             NSLog(@"galleryKeyImageURL: %@", galleryKeyImageURL);
             return galleryKeyImageURL;
-        } 
-        
+        }
+
         return nil;
     }
 }
                                                     kTURAnselAPIParamPerms,
                                                     kTURAnselAPIParamThumbnailStyle,
                                                     kTURAnselAPIParamFullPath, nil];
-        
+
         NSDictionary *response = [anselController callRPCMethod: @"images.listImages"
                                                      withParams: params
                                                       withOrder: order];
         if (response) {
             [imageList autorelease];
             imageList = [[response objectForKey: (id)kWSMethodInvocationResult] retain];
-            
+
             NSLog(@"listImages: %@", imageList);
         }
     }
-    
+
     return imageList;;
 }
-    
+
 /**
  * Upload the provided image to this gallery.
  */
         NSArray *params = [[NSArray alloc] initWithObjects:
                            @"ansel",                                  // app
                            [NSNumber numberWithInt: _galleryId],      // gallery_id
-                           [imageParameters valueForKey: @"data"],    // image data array   
+                           [imageParameters valueForKey: @"data"],    // image data array
                            [imageParameters valueForKey: @"default"], // set as default?
-                           @"",                                       // Additional gallery data to set?      
-                           @"base64",                                 // Image data encoding      
+                           @"",                                       // Additional gallery data to set?
+                           @"base64",                                 // Image data encoding
                            nil];
         NSArray *order = [NSArray arrayWithObjects: kTURAnselAPIParamScope,
                                                     kTURAnselAPIParamGalleryId,
                                                     kTURAnselAPIParamSetAsDefault,
                                                     kTURAnselAPIParamAdditionalData,
                                                     kTURAnselAPIParamEncoding, nil];
-        
+
         // Send the request up to the controller
         NSDictionary *result = [anselController callRPCMethod: @"images.saveImage"
                                                    withParams: params
                                                     withOrder: order];
-    
+
         if (result) {
             if ([delegate respondsToSelector:@selector(TURAnselGalleryDidUploadImage:)]) {
                 [delegate performSelectorOnMainThread: @selector(TURAnselGalleryDidUploadImage:)
-                                           withObject: self 
+                                           withObject: self
                                         waitUntilDone: NO];
             }
         }
-    
+
         [params release];
 }
 @end
index e3c5a20..7060838 100644 (file)
@@ -17,7 +17,7 @@ $page = Horde_Util::getFormData('page', 0);
 /* If we have a single gallery, check perms now */
 if (!empty($gallery_id)) {
     $gallery = $ansel_storage->getGallery($gallery_id);
-    if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(_("You are not allowed to edit these photos."), 'horde.error');
         Horde_Util::closeWindowJS('window.opener.location.href = window.opener.location.href; window.close();');
         exit;
@@ -47,7 +47,7 @@ if ($actionID == 'edit_dates') {
                 // Images might be from different galleries
                 $gallery = $ansel_storage->getGallery($image->gallery);
                 if (is_a($gallery, 'PEAR_Error') ||
-                    !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+                    !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                     continue;
                 }
             }
index dc68aba..dc4a4bc 100644 (file)
@@ -29,7 +29,7 @@ if (is_a($image, 'PEAR_Error')) {
 }
 
 $gallery = $ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $notification->push(_("Access denied editing the photo."));
     header('Location: ' . Ansel::getUrlFor('view', array('gallery' => $image->gallery)));
     exit;
index d2e7335..34e2b06 100644 (file)
@@ -20,7 +20,7 @@ if (is_a($image, 'PEAR_Error')) {
 }
 
 $gallery = &$ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     die(_("Access denied editing the photo."));
 }
 
index 04c4807..fe78eb3 100644 (file)
@@ -24,7 +24,7 @@ if (is_a($gallery, 'PEAR_Error')) {
     $notification->push($gallery->getMessage(), 'horde.error');
     header('Location: ' . Ansel::getUrlFor('view', array('gallery' => $gallery_id)));
     exit;
-} elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+} elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $notification->push(sprintf(_("Access denied editing gallery \"%s\"."), $gallery->get('name')), 'horde.error');
     header('Location: ' . Ansel::getUrlFor('view', array('gallery' => $gallery_id)));
     exit;
index 9a5cf5e..675ded9 100644 (file)
@@ -17,9 +17,9 @@ $name = Horde_Util::getFormData('name');
 
 $image = &$ansel_storage->getImage($image_id);
 $gallery = &$ansel_storage->getGallery($image->gallery);
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     throw new Horde_Exception('Access denied editing the photo.');
 }
 
 $faces = Ansel_Faces::factory();
-$result = $faces->setName($face_id, $name);
\ No newline at end of file
+$result = $faces->setName($face_id, $name);
index de22af1..a9de34f 100644 (file)
@@ -49,7 +49,7 @@ case 'addchild':
         $notification->push($parent->getMessage(), 'horde.error');
         header('Location: ' . Horde::applicationUrl('view.php?view=List', true));
         exit;
-    } elseif (!$parent->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    } elseif (!$parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(
             sprintf(_("Access denied adding a gallery to \"%s\"."),
                     $parent->get('name')), 'horde.error');
@@ -80,7 +80,7 @@ case 'downloadzip':
     $galleryId = Horde_Util::getFormData('gallery');
     $gallery = $ansel_storage->getGallery($galleryId);
     if (!Horde_Auth::getAuth() || is_a($gallery, 'PEAR_Error') ||
-        !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
 
         $name = is_a($gallery, 'PEAR_Error')
                      ? $galleryId
@@ -123,7 +123,7 @@ case 'save':
     // Check general permissions.
     if (!Horde_Auth::isAdmin() &&
         ($GLOBALS['perms']->exists('ansel') &&
-         !$GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), PERMS_EDIT))) {
+         !$GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT))) {
         $notification->push(_("Access denied editing galleries."), 'horde.error');
         header('Location: ' . Horde::applicationUrl('view.php?view=List', true));
         exit;
@@ -161,7 +161,7 @@ case 'save':
         // Modifying an existing gallery.
         $gallery = $ansel_storage->getGallery($galleryId);
         if (is_a($gallery, 'PEAR_Error') ||
-            !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
 
             $name = is_a($gallery, 'PEAR_Error')
                     ? $galleryId
@@ -228,7 +228,7 @@ case 'save':
                 header('Location: ' . Horde::applicationUrl(
                     Ansel::getUrlFor('view', array('view' => 'List'), true)));
                 exit;
-            } elseif (!$parent->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            } elseif (!$parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                 $notification->push(sprintf(
                     _("You do not have permission to add children to %s."),
                     $parent->get('name')), 'horde.error');
index 9aa3744..4f98002 100644 (file)
@@ -25,7 +25,7 @@ if (is_a($gallery, 'PEAR_Error')) {
     exit;
 }
 
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $notification->push(sprintf(_("Access denied setting captions for %s."), $gallery->get('name')), 'horde.error');
     header('Location: ' . Ansel::getUrlFor('view', array('view' => 'List'),
                                            true));
index b94e7e4..bf15aab 100644 (file)
@@ -21,7 +21,7 @@ if ($galleryId) {
     case 'delete':
         if (is_a($gallery, 'PEAR_Error')) {
             $notification->push($gallery->getMessage(), 'horde.error');
-        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
             $notification->push(sprintf(_("Access denied deleting gallery \"%s\"."),
                                         $gallery->get('name')), 'horde.error');
         } else {
@@ -50,7 +50,7 @@ if ($galleryId) {
     case 'empty':
         if (is_a($gallery, 'PEAR_Error')) {
             $notification->push($gallery->getMessage(), 'horde.error');
-        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
             $notification->push(sprintf(_("Access denied deleting gallery \"%s\"."),
                                         $gallery->get('name')),
                                 'horde.error');
index 68f9873..86d3415 100644 (file)
@@ -25,7 +25,7 @@ if (is_a($gallery, 'PEAR_Error')) {
     header('Location: ' . Ansel::getUrlFor('view', array('view' => 'List'),
                                            true));
     exit;
-} elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+} elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $notification->push(sprintf(_("Access denied editing gallery \"%s\"."), $gallery->get('name')), 'horde.error');
     header('Location: ' . Ansel::getUrlFor('view', array('view' => 'List'),
                                            true));
index 68f2e7d..f4c8633 100644 (file)
@@ -27,13 +27,13 @@ $groups_perpage = $prefs->getValue('groupsperpage');
 
 switch ($groupby) {
 case 'category':
-    $num_groups = $ansel_storage->countCategories(PERMS_SHOW);
+    $num_groups = $ansel_storage->countCategories(Horde_Perms::SHOW);
     if (is_a($num_groups, 'PEAR_Error')) {
         $notification->push($num_groups);
         $num_groups = 0;
         $groups = array();
     } elseif ($num_groups) {
-        $groups = $ansel_storage->listCategories(PERMS_SHOW,
+        $groups = $ansel_storage->listCategories(Horde_Perms::SHOW,
                                                  $gbpage * $groups_perpage,
                                                  $groups_perpage);
     } else {
@@ -42,14 +42,14 @@ case 'category':
     break;
 
 case 'owner':
-    $num_groups = $ansel_storage->shares->countOwners(PERMS_SHOW, null,
+    $num_groups = $ansel_storage->shares->countOwners(Horde_Perms::SHOW, null,
                                                       false);
     if (is_a($num_groups, 'PEAR_Error')) {
         $notification->push($num_groups);
         $num_groups = 0;
         $groups = array();
     } elseif ($num_groups) {
-        $groups = $ansel_storage->shares->listOwners(PERMS_SHOW, null,
+        $groups = $ansel_storage->shares->listOwners(Horde_Perms::SHOW, null,
                                                      false,
                                                      $gbpage * $groups_perpage,
                                                      $groups_perpage);
index 7a46881..23e6a08 100644 (file)
@@ -163,7 +163,7 @@ case 'savecloseimage':
 case 'saveclose':
 case 'save':
     $title = _("Save Photo");
-    if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied saving photo to \"%s\"."), $gallery->get('name')),
                             'horde.error');
         $imageurl = Ansel::getUrlFor('view', array_merge(
@@ -289,7 +289,7 @@ case 'resizeedit':
                                              'slug' => $gallery->get('slug')),
                                        $date));
 
-    if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(_("Access denied editing the photo."),
                             'horde.error');
 
@@ -341,7 +341,7 @@ case 'resizeedit':
     exit;
 
 case 'watermark':
-    if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied saving photo to \"%s\"."),
                                     $gallery->get('name')),
                             'horde.error');
@@ -383,7 +383,7 @@ case 'mirror':
 case 'grayscale':
 case 'crop':
 case 'resize':
-    if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied saving photo to \"%s\"."),
                                     $gallery->get('name')),
                             'horde.error');
@@ -555,7 +555,7 @@ case 'delete':
 
     /* Delete the images if we're provided with a valid image ID. */
     if (count($images)) {
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
             $notification->push(sprintf(_("Access denied deleting photos from \"%s\"."), $gallery->get('name')), 'horde.error');
         } else {
             foreach ($images as $image) {
@@ -573,7 +573,7 @@ case 'delete':
     }
 
     /* Recalculate the number of pages, since it might have changed */
-    $children = $gallery->countGalleryChildren(PERMS_SHOW);
+    $children = $gallery->countGalleryChildren(Horde_Perms::SHOW);
     $perpage = min($prefs->getValue('tilesperpage'),
                    $conf['thumbnail']['perpage']);
     $pages = ceil($children / $perpage);
@@ -621,7 +621,7 @@ case 'move':
     }
 
     /* Recalculate the number of pages, since it might have changed */
-    $children = $gallery->countGalleryChildren(PERMS_SHOW);
+    $children = $gallery->countGalleryChildren(Horde_Perms::SHOW);
     $perpage = min($prefs->getValue('tilesperpage'),
                    $conf['thumbnail']['perpage']);
     $pages = ceil($children / $perpage);
@@ -684,7 +684,7 @@ case 'downloadzip':
     if ($galleryId) {
         $gallery = $ansel_storage->getGallery($galleryId);
         if (!Horde_Auth::getAuth() || is_a($gallery, 'PEAR_Error') ||
-            !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ) ||
+            !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) ||
             $gallery->hasPasswd() || !$gallery->isOldEnough()) {
 
             $name = is_a($gallery, 'PEAR_Error') ? $galleryId : $gallery->get('name');
@@ -714,7 +714,7 @@ case 'downloadzip':
 
 case 'previewcrop':
 
-    if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(_("Access denied editing the photo."), 'horde.error');
         $imageurl = Ansel::getUrlFor(
             'view', array('gallery' => $gallery_id,
@@ -746,7 +746,7 @@ case 'previewcrop':
     exit;
 
 case 'imagecrop':
-        if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $params = Horde_Util::getFormData('params');
             list($x1, $y1, $x2, $y2) = explode('.', $params);
             $image = &$ansel_storage->getImage($image_id);
index fab3bad..528dcea 100644 (file)
@@ -19,7 +19,7 @@ $gallery = $ansel_storage->getGallery($image->gallery);
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal($gallery, __FILE__, __LINE__);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ) ||
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) ||
     !$gallery->canDownload()) {
     Horde::fatal(_("Access denied viewing this photo."), __FILE__, __LINE__);
 }
index 3d4a93d..2737e82 100644 (file)
@@ -19,7 +19,7 @@ $gallery = $ansel_storage->getGallery($image->gallery);
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal($gallery, __FILE__, __LINE__);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ) ||
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) ||
     !$gallery->canDownload()) {
     Horde::fatal(_("Access denied viewing this photo."), __FILE__, __LINE__);
 }
index 17791fe..c5a7d07 100644 (file)
@@ -19,7 +19,7 @@ $gallery = $ansel_storage->getGallery($image->gallery);
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal($gallery, __FILE__, __LINE__);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     Horde::fatal(_("Access denied viewing this photo."), __FILE__, __LINE__);
 }
 
index 0c14a03..f15e967 100644 (file)
@@ -19,7 +19,7 @@ $gallery = $ansel_storage->getGallery(abs($image->gallery));
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal($gallery, __FILE__, __LINE__);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     Horde::fatal(_("Access denied viewing this photo."), __FILE__, __LINE__);
 }
 
index 6c3cbd3..8dec233 100644 (file)
@@ -20,7 +20,7 @@ $gallery = $ansel_storage->getGallery(abs($image->gallery));
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal($gallery, __FILE__, __LINE__);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     Horde::fatal(_("Access denied viewing this photo."), __FILE__, __LINE__);
 }
 
index d7ec536..7cc8f64 100644 (file)
@@ -19,7 +19,7 @@ $gallery = $ansel_storage->getGallery($image->gallery);
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal($gallery, __FILE__, __LINE__);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     Horde::fatal(_("Access denied viewing this photo."), __FILE__, __LINE__);
 }
 
index 4c4700e..c72995b 100644 (file)
@@ -19,7 +19,7 @@ $gallery = $ansel_storage->getGallery(abs($image->gallery));
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal($gallery, __FILE__, __LINE__);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     Horde::fatal(_("Access denied viewing this photo."), __FILE__, __LINE__);
 }
 
index 2282a6c..b89deb6 100644 (file)
@@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/../lib/base.php';
 $gallery_id = (int)Horde_Util::getFormData('gallery');
 $gallery = $ansel_storage->getGallery($gallery_id);
 if (is_a($gallery, 'PEAR_Error') ||
-    !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+    !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     die(sprintf(_("Gallery %s not found."), $gallery_id));
 }
 
index 38f3795..4362228 100644 (file)
@@ -57,7 +57,7 @@ Ansel_GMap.prototype = {
     //                              deletion is successful
 
     //        .clickHandler - optional callback to handle click events on the mainMap
-    //        .hasEdit - Has PERMS_EDIT on the image
+    //        .hasEdit - Has Horde_Perms::EDIT on the image
     //        .calculateMaxZoom - call Google's getMaxZoomAtLatLng() method to
     //                            avoid autozooming in to a level with no detail.
     //                            Performance penalty because we make another
@@ -484,4 +484,4 @@ document.observe('dom:loaded', function () {
     anselGOverlay.prototype.getLatLng = function() {
         return this.latlng_;
     }
-});
\ No newline at end of file
+});
index 5d3d812..e6470f4 100644 (file)
@@ -70,7 +70,7 @@ class Ansel_Ajax_Imple_EditCaption extends Horde_Ajax_Imple_Base
             $id = $args['id'];
             $image = $GLOBALS['ansel_storage']->getImage($id);
             $g = $GLOBALS['ansel_storage']->getGallery($image->gallery);
-            if ($g->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            if ($g->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                 $image->caption = $pref_value;
                 $result = $image->save();
                 if (is_a($result, 'PEAR_Error')) {
index 3f33ce0..8e6d1e0 100644 (file)
@@ -75,7 +75,7 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base
                 $face_id = (int)$post['face'];
                 $image = &$GLOBALS['ansel_storage']->getImage($image_id);
                 $gallery = &$GLOBALS['ansel_storage']->getGallery($image->gallery);
-                if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+                if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                     throw new Horde_Exception('Access denied editing the photo.');
                 }
 
@@ -93,7 +93,7 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base
                 $name = $post['facename'];
                 $image = &$GLOBALS['ansel_storage']->getImage($image_id);
                 $gallery = &$GLOBALS['ansel_storage']->getGallery($image->gallery);
-                if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+                if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                     throw new Horde_Exception('You are not allowed to edit this photo');
                 }
 
index e1ad51d..a8582ce 100644 (file)
@@ -49,7 +49,7 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base
             return array('response' => 0);
         }
         // Bail out if no perms on the image.
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             return array('response' => 0);
         }
         switch ($type) {
index f0fcd7d..60da9d9 100644 (file)
@@ -81,7 +81,7 @@ class Ansel_Ajax_Imple_TagActions extends Horde_Ajax_Imple_Base
 
                 return array('response' => 1,
                              'message' => $this->_getTagHtml($newTags, $owner,
-                                                             $parent->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)));
+                                                             $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)));
             }
             break;
 
@@ -97,7 +97,7 @@ class Ansel_Ajax_Imple_TagActions extends Horde_Ajax_Imple_Base
 
             return array('response' => 1,
                          'message' => $this->_getTagHtml($newTags, $owner,
-                                                         $parent->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)));
+                                                         $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)));
             break;
         }
 
index f7555b9..df933c5 100644 (file)
@@ -103,7 +103,7 @@ class Ansel
      *
      * @return string  The <option> list.
      */
-    static public function selectGalleries($selected = null, $perm = PERMS_SHOW,
+    static public function selectGalleries($selected = null, $perm = Horde_Perms::SHOW,
                              $attributes = null, $parent = null,
                              $allLevels = true, $from = 0, $count = 0,
                              $ignore = null)
@@ -640,7 +640,7 @@ class Ansel
         /* Let authenticated users create new galleries. */
         if (Horde_Auth::isAdmin() ||
             (!$GLOBALS['perms']->exists('ansel') && Horde_Auth::getAuth()) ||
-            $GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), PERMS_EDIT)) {
+            $GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $menu->add(Horde::applicationUrl(Horde_Util::addParameter('gallery.php', 'actionID', 'add')),
                        _("_New Gallery"), 'add.png', null, null, null,
                        (basename($_SERVER['PHP_SELF']) == 'gallery.php' &&
index 6693947..4637a73 100644 (file)
@@ -40,7 +40,7 @@ class Ansel_Api extends Horde_Registry_Api
 
         if (empty($path)) {
             $owners = array();
-            $galleries = $GLOBALS['ansel_storage']->listGalleries(PERMS_SHOW, null, null, false);
+            $galleries = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, null, null, false);
             foreach ($galleries  as $gallery) {
                 $owners[$gallery->data['share_owner']] = true;
             }
@@ -77,7 +77,7 @@ class Ansel_Api extends Horde_Registry_Api
             if (count($parts) == 1) {
                 // This request is for all galleries owned by the requested user.
                 $galleries = $GLOBALS['ansel_storage']->listGalleries(
-                    PERMS_SHOW, $parts[0], null, false);
+                    Horde_Perms::SHOW, $parts[0], null, false);
                 $images = array();
             } elseif ($this->galleryExists(null, end($parts))) {
                 // This request if for a certain gallery, list all sub-galleries
@@ -87,13 +87,13 @@ class Ansel_Api extends Horde_Registry_Api
                     array($gallery_id));
                 if (!isset($galleries[$gallery_id]) ||
                     !$galleries[$gallery_id]->hasPermission(Horde_Auth::getAuth(),
-                        PERMS_READ)) {
+                        Horde_Perms::READ)) {
                             return PEAR::raiseError(_("Invalid gallery specified."), 404);
                         }
                 $galleries = $GLOBALS['ansel_storage']->listGalleries(
-                    PERMS_SHOW, null, $gallery_id, false);
+                    Horde_Perms::SHOW, null, $gallery_id, false);
 
-                $images = $this->listImages(null, $gallery_id, PERMS_SHOW, 'mini');
+                $images = $this->listImages(null, $gallery_id, Horde_Perms::SHOW, 'mini');
             } elseif (count($parts) > 2 &&
                 $this->galleryExists(null, $parts[count($parts) - 2]) &&
                 !is_a($image = $GLOBALS['ansel_storage']->getImage(end($parts)), 'PEAR_Error')) {
@@ -120,7 +120,7 @@ class Ansel_Api extends Horde_Registry_Api
                 }
                 if (in_array('browseable', $properties)) {
                     $results[$retpath]['browseable'] = $gallery->hasPermission(
-                        Horde_Auth::getAuth(), PERMS_READ);
+                        Horde_Auth::getAuth(), Horde_Perms::READ);
                 }
                 if (in_array('contenttype', $properties)) {
                     $results[$retpath]['contenttype'] = 'httpd/unix-directory';
@@ -198,7 +198,7 @@ class Ansel_Api extends Horde_Registry_Api
             return PEAR::raiseError("Gallery does not exist");
         }
         $gallery = $GLOBALS['ansel_storage']->getGallery($gallery_id);
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             return PEAR::raiseError(_("Access denied adding photos to \"%s\"."));
         }
 
@@ -354,7 +354,7 @@ class Ansel_Api extends Horde_Registry_Api
                 return $gallery;
             }
         }
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             return PEAR::raiseError(sprintf(_("Access denied adding photos to \"%s\"."), $gallery->get('name')));
         }
         if (!empty($gallery_data)) {
@@ -439,7 +439,7 @@ class Ansel_Api extends Horde_Registry_Api
         }
         $gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
         if (is_a($gallery, 'PEAR_Error') ||
-            !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+            !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
 
                 return PEAR::raiseError(sprintf(_("Access denied deleting photos from \"%s\"."), $gallery->get('name')));
             }
@@ -454,8 +454,8 @@ class Ansel_Api extends Horde_Registry_Api
      *                               (@see Ansel_Storage::createGallery).
      * @param array $perm            An array of permission data if Ansel's defaults
      *                               are not desired. Takes an array like:
-     *                               array('guest' => PERMS_SHOW | PERMS_READ,
-     *                                     'default' => PERMS_SHOW | PERMS_READ);
+     *                               array('guest' => Horde_Perms::SHOW | Horde_Perms::READ,
+     *                                     'default' => Horde_Perms::SHOW | Horde_Perms::READ);
      * @param integer $parent        The gallery id of the parent gallery, if any.
      *
      * @return mixed  The gallery id of the new gallery | PEAR_Error
@@ -466,7 +466,7 @@ class Ansel_Api extends Horde_Registry_Api
 
         if (!(Horde_Auth::isAdmin() ||
             (!$GLOBALS['perms']->exists('ansel') && Horde_Auth::getAuth()) ||
-            $GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), PERMS_EDIT))) {
+            $GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT))) {
                 return PEAR::raiseError(_("Access denied creating new galleries."));
             }
 
@@ -517,7 +517,7 @@ class Ansel_Api extends Horde_Registry_Api
         if (is_a($gallery, 'PEAR_Error')) {
             return PEAR::raiseError(sprintf(_("Access denied deleting gallery \"%s\"."),
                 $gallery->getMessage()));
-        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
             return PEAR::raiseError(sprintf(_("Access denied deleting gallery \"%s\"."),
                 $gallery->get('name')));
         } else {
@@ -711,7 +711,7 @@ class Ansel_Api extends Horde_Registry_Api
      *
      * @return array  An array of gallery information.
      */
-    public function listGalleries($app = null, $perm = PERMS_SHOW,
+    public function listGalleries($app = null, $perm = Horde_Perms::SHOW,
         $parent = null,
         $allLevels = true, $from = 0, $count = 0,
         $attributes = null, $sort_by = null, $direction = 0)
@@ -768,10 +768,10 @@ class Ansel_Api extends Horde_Registry_Api
         }
 
         /* We can't just return the results of the getGalleries call - we need to
-        ensure the caller has at least PERMS_READ on the galleries. */
+        ensure the caller has at least Horde_Perms::READ on the galleries. */
         $galleries = array();
         foreach ($results as $gallery) {
-            if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+            if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
                 $galleries[$gallery->id] = array_merge($gallery->data, array('crumbs' => $gallery->getGalleryCrumbData()));
             }
         }
@@ -793,7 +793,7 @@ class Ansel_Api extends Horde_Registry_Api
      *                            selected by default in the returned option
      *                            list.
      */
-    public function selectGalleries($app = null, $perm = PERMS_SHOW,
+    public function selectGalleries($app = null, $perm = Horde_Perms::SHOW,
         $parent = null,
         $allLevels = true, $from = 0, $count = 0,
         $default = null)
@@ -830,7 +830,7 @@ class Ansel_Api extends Horde_Registry_Api
      *
      * @return array  Two dimensional array with image names ids (key) and urls.
      */
-    public function listImages($app = null, $gallery_id = null, $perm = PERMS_SHOW,
+    public function listImages($app = null, $gallery_id = null, $perm = Horde_Perms::SHOW,
         $view = 'screen', $full = false, $from = 0,
         $count = 0, $style = null, $slug = '')
     {
@@ -894,7 +894,7 @@ class Ansel_Api extends Horde_Registry_Api
      * @param array $galleries  An array of gallery ids to check.  If left empty,
      *                          will search all galleries with the given
      *                          permissions for the current user.
-     * @param integer $perms    PERMS_* constant
+     * @param integer $perms    Horde_Perms::* constant.
      * @param string $view      The type of image view to return.
      * @param boolean $full     Return a full URL if this is true.
      * @param integer  $limit   The maximum number of images to return.
@@ -904,7 +904,7 @@ class Ansel_Api extends Horde_Registry_Api
      * @return array  An array of image objects.
      */
     public function getRecentImages($app = null, $galleries = array(),
-        $perms = PERMS_SHOW, $view = 'screen',
+        $perms = Horde_Perms::SHOW, $view = 'screen',
         $full = false, $limit = 10, $style = null,
         $slugs = array())
     {
@@ -949,7 +949,7 @@ class Ansel_Api extends Horde_Registry_Api
      *
      * @return integer  Returns the number of matching galleries.
      */
-    public function countGalleries($app = null, $perm = PERMS_SHOW, $attributes = null,
+    public function countGalleries($app = null, $perm = Horde_Perms::SHOW, $attributes = null,
         $parent = null, $allLevels = true)
     {
         require_once dirname(__FILE__) . '/base.php';
index 91e3d41..d5e182f 100644 (file)
@@ -38,7 +38,7 @@ class Horde_Block_ansel_gallery extends Horde_Block {
                             'type' => 'checkbox',
                             'default' => true));
 
-        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), PERMS_READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
             foreach ($GLOBALS['ansel_storage']->listGalleries() as $gal) {
                 $params['gallery']['values'][$gal->id] = $gal->get('name');
             }
@@ -100,7 +100,7 @@ class Horde_Block_ansel_gallery extends Horde_Block {
                             $gallery->get('name')));
 
         if ($iid = $gallery->getDefaultImage('ansel_default') &&
-            $gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+            $gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
 
             $html .= '<img src="' . Ansel::getImageUrl($gallery->getDefaultImage('ansel_default'), 'thumb', true) . '" alt="' . htmlspecialchars($gallery->get('name')) . '" />';
         } else {
@@ -141,7 +141,7 @@ class Horde_Block_ansel_gallery extends Horde_Block {
         if (empty($this->_gallery)) {
             return PEAR::raiseError(_("Gallery does not exist."));
         } elseif (is_a($this->_gallery, 'PEAR_Error') ||
-                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW) ||
+                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) ||
                   !$this->_gallery->isOldEnough() || $this->_gallery->hasPasswd()) {
             return PEAR::raiseError(_("Access denied viewing this gallery."));
         }
index 92678c5..deb9e65 100644 (file)
@@ -40,7 +40,7 @@ class Horde_Block_ansel_my_galleries extends Horde_Block {
         Horde::addScriptFile('ToolTips.js', 'horde');
         /* Get the top level galleries */
         $galleries = $GLOBALS['ansel_storage']->listGalleries(
-            PERMS_EDIT, Horde_Auth::getAuth(), null, false, 0,
+            Horde_Perms::EDIT, Horde_Auth::getAuth(), null, false, 0,
             empty($this->_params['limit']) ? 0 : $this->_params['limit'],
             'last_modified', 1);
 
index cdf80b2..b644693 100644 (file)
@@ -31,8 +31,8 @@ class Horde_Block_ansel_recent_comments extends Horde_Block {
                             'default' => '__random',
                             'values' => array('all' => 'All')));
 
-        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), PERMS_READ) < $GLOBALS['conf']['gallery']['listlimit']) {
-            foreach ($GLOBALS['ansel_storage']->listGalleries(PERMS_READ) as $id => $gal) {
+        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+            foreach ($GLOBALS['ansel_storage']->listGalleries(Horde_Perms::READ) as $id => $gal) {
                 $params['gallery']['values'][$id] = $gal->get('name');
             }
         }
@@ -148,7 +148,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block {
         if (empty($this->_gallery)) {
             return PEAR::raiseError(_("Gallery does not exist."));
         } elseif (is_a($this->_gallery, 'PEAR_Error') ||
-                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             return PEAR::raiseError(_("Access denied viewing this gallery."));
         }
 
index c93fc1e..70935f6 100644 (file)
@@ -33,8 +33,8 @@ class Horde_Block_ansel_recently_added extends Horde_Block {
                              'default' => 10),
         );
 
-        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), PERMS_READ) < $GLOBALS['conf']['gallery']['listlimit']) {
-            foreach ($GLOBALS['ansel_storage']->listGalleries(PERMS_READ) as $id => $gal) {
+        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+            foreach ($GLOBALS['ansel_storage']->listGalleries(Horde_Perms::READ) as $id => $gal) {
                 if (!$gal->hasPasswd() && $gal->isOldEnough()) {
                     $params['gallery']['values'][$id] = $gal->get('name');
                 }
@@ -191,7 +191,7 @@ HEADER;
         if (empty($this->_gallery)) {
             return PEAR::raiseError(_("Gallery does not exist."));
         } elseif (is_a($this->_gallery, 'PEAR_Error') ||
-                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             return PEAR::raiseError(_("Access denied viewing this gallery."));
         }
 
index 29f4b32..2a29247 100644 (file)
@@ -37,8 +37,8 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
                              'default' => 250),
         );
 
-        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), PERMS_READ) < $GLOBALS['conf']['gallery']['listlimit']) {
-            foreach ($GLOBALS['ansel_storage']->listGalleries(PERMS_READ) as $id => $gal) {
+        if ($GLOBALS['ansel_storage']->countGalleries(Horde_Auth::getAuth(), Horde_Perms::READ) < $GLOBALS['conf']['gallery']['listlimit']) {
+            foreach ($GLOBALS['ansel_storage']->listGalleries(Horde_Perms::READ) as $id => $gal) {
                 if (!$gal->hasPasswd() && $gal->isOldEnough()) {
                     $params['gallery']['values'][$id] = $gal->get('name');
                 }
@@ -167,7 +167,7 @@ EOT;
         if (empty($this->_gallery)) {
             return PEAR::raiseError(_("Gallery does not exist."));
         } elseif (is_a($this->_gallery, 'PEAR_Error') ||
-                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+                  !$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             return PEAR::raiseError(_("Access denied viewing this gallery."));
         }
 
index a4ae808..ad0b027 100644 (file)
@@ -166,7 +166,7 @@ class Ansel_Faces_Base
         // an internally generated query string fragment. Will need to split
         // this out into two seperate operations somehow.
         $share = substr($GLOBALS['ansel_storage']->shares->_getShareCriteria(
-            Horde_Auth::getAuth(), PERMS_READ), 5);
+            Horde_Auth::getAuth(), Horde_Perms::READ), 5);
 
         $sql = 'SELECT f.face_id, f.gallery_id, f.image_id, f.face_name FROM ansel_faces f, '
                 . str_replace('WHERE', 'WHERE (', $share)
@@ -203,7 +203,7 @@ class Ansel_Faces_Base
         // add gallery permission
         // FIXME: Ditto on the REALLY ugly hack comment from above!
         $share = substr($GLOBALS['ansel_storage']->shares->_getShareCriteria(
-            Horde_Auth::getAuth(), PERMS_READ), 5);
+            Horde_Auth::getAuth(), Horde_Perms::READ), 5);
 
         $sql = 'SELECT COUNT(*) FROM ansel_faces f, '
                 . str_replace('WHERE', 'WHERE (', $share)
@@ -435,7 +435,7 @@ class Ansel_Faces_Base
     {
         $image = &$GLOBALS['ansel_storage']->getImage($image);
         $gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             //TODO: Do we throw exceptions for access denied?
             throw new Horde_Exception('Access denied editing the photo.');
         }
@@ -524,7 +524,7 @@ class Ansel_Faces_Base
         if (!is_a($image, 'Ansel_Image')) {
             $image = &$GLOBALS['ansel_storage']->getImage($image);
             $gallery = $GLOBALS['ansel_storage']->getGallery($image->gallery);
-            if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                 throw new Horde_Exception('Access denied editing the photo.');
             }
         }
@@ -715,7 +715,7 @@ class Ansel_Faces_Base
     public function getFromGallery($gallery_id, $create = false, $force = false)
     {
         $gallery = $GLOBALS['ansel_storage']->getGallery($gallery_id);
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             throw new Horde_Exception(sprintf("Access denied editing gallery \"%s\".", $gallery->get('name')));
         }
 
index cbc3ec0..d11ca9d 100644 (file)
@@ -93,7 +93,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
             return Horde_Auth::isAuthenticated();
 
         case 'edit':
-            return $this->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+            return $this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
 
         case 'hook':
             return Horde::callHook('_ansel_hook_can_download', array($this->id));
@@ -316,7 +316,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
      */
     public function copyImagesTo($images, $gallery)
     {
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             throw new Horde_Exception(sprintf(_("Access denied copying photos to \"%s\"."), $gallery->get('name')));
         }
 
@@ -448,7 +448,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
      * @return A mixed array of Ansel_Gallery and Ansel_Image objects that are
      *         children of this gallery.
      */
-    public function getGalleryChildren($perm = PERMS_SHOW, $from = 0, $to = 0, $noauto = true)
+    public function getGalleryChildren($perm = Horde_Perms::SHOW, $from = 0, $to = 0, $noauto = true)
     {
         return $this->_modeHelper->getGalleryChildren($perm, $from, $to, $noauto);
     }
@@ -462,7 +462,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
      *
      * @return integer The count of this gallery's children.
      */
-    public function countGalleryChildren($perm = PERMS_SHOW, $galleries_only = false, $noauto = true)
+    public function countGalleryChildren($perm = Horde_Perms::SHOW, $galleries_only = false, $noauto = true)
     {
         return $this->_modeHelper->countGalleryChildren($perm, $galleries_only, $noauto);
     }
@@ -637,7 +637,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
             if ($this->hasSubGalleries()) {
                 // Fall through to a default image of a sub gallery.
                 try {
-                    $galleries = $GLOBALS['ansel_storage']->listGalleries(PERMS_SHOW, null, $this, false);
+                    $galleries = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, null, $this, false);
                 } catch (Horde_Exception $e) {
                     return false;
                 }
@@ -661,7 +661,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
      * @throws Horde_Exception
      */
     public function getTags() {
-        if ($this->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        if ($this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             return Ansel_Tags::readTags($this->id, 'gallery');
         } else {
             throw new Horde_Exception(_("Access denied viewing this gallery."));
@@ -678,7 +678,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
      */
     public function setTags($tags)
     {
-        if ($this->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if ($this->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             return Ansel_Tags::writeTags($this->id, $tags, 'gallery');
         } else {
             throw new Horde_Exception(_("Access denied adding tags to this gallery."));
@@ -725,7 +725,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
      * Checks to see if a user has a given permission.
      *
      * @param string $userid       The userid of the user.
-     * @param integer $permission  A PERMS_* constant to test for.
+     * @param integer $permission  A Horde_Perms::* constant to test for.
      * @param string $creator      The creator of the event.
      *
      * @return boolean  Whether or not $userid has $permission.
@@ -815,7 +815,7 @@ class Ansel_Gallery extends Horde_Share_Object_sql_hierarchical
         $old = $this->getParent();
         $reset_has_subgalleries = false;
         if (!is_null($old)) {
-            $cnt = $old->countGalleryChildren(PERMS_READ, true);
+            $cnt = $old->countGalleryChildren(Horde_Perms::READ, true);
             if ($cnt == 1) {
                 /* Count is 1, and we are about to delete it */
                 $reset_has_subgalleries = true;
index 97bf1a5..7a9ff32 100644 (file)
@@ -155,7 +155,7 @@ class Ansel_GalleryMode_Date {
     {
         if (!is_array($this->_subGalleries)) {
             /* Get a list of all the subgalleries */
-            $subs = $GLOBALS['ansel_storage']->listGalleries(PERMS_SHOW, null, $this->_gallery);
+            $subs = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, null, $this->_gallery);
             if (is_a($subs, 'PEAR_Error')) {
                 return $subs;
             }
@@ -172,7 +172,7 @@ class Ansel_GalleryMode_Date {
      *
      * @return A mixed array of Ansel_Gallery_Date and Ansel_Image objects.
      */
-    function getGalleryChildren($perm = PERMS_SHOW, $from = 0, $to = 0, $noauto = false)
+    function getGalleryChildren($perm = Horde_Perms::SHOW, $from = 0, $to = 0, $noauto = false)
     {
         global $ansel_db, $ansel_storage;
 
@@ -366,7 +366,7 @@ class Ansel_GalleryMode_Date {
      *                 etc..) that need to be displayed, or a count of all the
      *                 images in the current date grouping (for a specific day).
      */
-    function countGalleryChildren($perm = PERMS_SHOW, $galleries_only = false, $noauto = true)
+    function countGalleryChildren($perm = Horde_Perms::SHOW, $galleries_only = false, $noauto = true)
     {
         $results = $this->getGalleryChildren($this->_date, 0, 0, $noauto);
         if (is_a($results, 'PEAR_Error')) {
@@ -420,9 +420,9 @@ class Ansel_GalleryMode_Date {
      */
     function moveImagesTo($images, $gallery)
     {
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             return PEAR::raiseError(sprintf(_("Access denied moving photos to \"%s\"."), $newGallery->get('name')));
-        } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+        } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
             return PEAR::raiseError(sprintf(_("Access denied removing photos from \"%s\"."), $gallery->get('name')));
         }
 
@@ -608,7 +608,7 @@ class Ansel_GalleryMode_Date {
     function getImages($from = 0, $count = 0)
     {
         /* Get all of this grouping's children. */
-        $children = $this->getGalleryChildren(PERMS_SHOW);
+        $children = $this->getGalleryChildren(Horde_Perms::SHOW);
 
         /* At day level, these are all Ansel_Images, otherwise they are
          * Ansel_Gallery_Date objects.
@@ -795,7 +795,7 @@ class Ansel_Gallery_Date {
      * @return A mixed array of Ansel_Gallery and Ansel_Image objects that are
      *         children of this gallery.
      */
-    function getGalleryChildren($perm = PERMS_SHOW, $from = 0, $to = 0, $noauto = false)
+    function getGalleryChildren($perm = Horde_Perms::SHOW, $from = 0, $to = 0, $noauto = false)
     {
         return $this->_modeHelper->getGalleryChildren($perm, $from, $to, $noauto);
     }
@@ -809,7 +809,7 @@ class Ansel_Gallery_Date {
      *
      * @return integer The count of this gallery's children.
      */
-    function countGalleryChildren($perm = PERMS_SHOW, $galleries_only = false, $noauto = true)
+    function countGalleryChildren($perm = Horde_Perms::SHOW, $galleries_only = false, $noauto = true)
     {
         // Need to force the date helper to not auto drill down when counting
         // from this method, since we are only called here when we are not
@@ -957,7 +957,7 @@ class Ansel_Gallery_Date {
      * Checks to see if a user has a given permission.
      *
      * @param string $userid       The userid of the user.
-     * @param integer $permission  A PERMS_* constant to test for.
+     * @param integer $permission  A Horde_Perms::* constant to test for.
      * @param string $creator      The creator of the event.
      *
      * @return boolean  Whether or not $userid has $permission.
@@ -980,12 +980,12 @@ class Ansel_Gallery_Date {
     /**
      * Return a count of the number of children this share has
      *
-     * @param integer $perm  A PERMS_* constant
+     * @param integer $perm  A Horde_Perms::* constant
      * @param boolean $allLevels  Count grandchildren or just children
      *
      * @return mixed  The number of child shares || PEAR_Error
      */
-    function countChildren($perm = PERMS_SHOW, $allLevels = true)
+    function countChildren($perm = Horde_Perms::SHOW, $allLevels = true)
     {
         return $this->_gallery->_shareOb->countShares(Horde_Auth::getAuth(), $perm, null, $this, $allLevels);
     }
@@ -993,13 +993,13 @@ class Ansel_Gallery_Date {
     /**
      * Get all children of this share.
      *
-     * @param int $perm           PERMS_* constant. If NULL will return all
-     *                            shares regardless of permissions.
+     * @param int $perm           Horde_Perms::* constant. If NULL will return
+     *                            all shares regardless of permissions.
      * @param boolean $allLevels  Return all levels.
      *
      * @return mixed  An array of Horde_Share_Object objects || PEAR_Error
      */
-    function getChildren($perm = PERMS_SHOW, $allLevels = true)
+    function getChildren($perm = Horde_Perms::SHOW, $allLevels = true)
     {
         return $this->_gallery->getChildren($perm, $allLevels);
     }
index fbda4ba..b1b044d 100644 (file)
@@ -55,7 +55,7 @@ class Ansel_GalleryMode_Normal {
      * @return A mixed array of Ansel_Gallery and Ansel_Image objects that are
      *         children of this gallery.
      */
-    function getGalleryChildren($perm = PERMS_SHOW, $from = 0, $to = 0)
+    function getGalleryChildren($perm = Horde_Perms::SHOW, $from = 0, $to = 0)
     {
         $galleries = array();
         $num_galleries = 0;
@@ -65,12 +65,12 @@ class Ansel_GalleryMode_Normal {
             /* Get the number of images and galleries */
             $numimages = $this->countImages();
             $num_galleries = $GLOBALS['ansel_storage']->countGalleries(
-                Horde_Auth::getAuth(), PERMS_SHOW, null, $this->_gallery, false);
+                Horde_Auth::getAuth(), Horde_Perms::SHOW, null, $this->_gallery, false);
 
             /* Now fetch the subgalleries, but only if we need to */
             if ($num_galleries > $from) {
                 $galleries = $GLOBALS['ansel_storage']->listGalleries(
-                    PERMS_SHOW, null, $this->_gallery, false, $from, $to);
+                    Horde_Perms::SHOW, null, $this->_gallery, false, $from, $to);
             }
         }
 
@@ -134,7 +134,7 @@ class Ansel_GalleryMode_Normal {
      *
      * @return integer The count of this gallery's children.
      */
-    function countGalleryChildren($perm = PERMS_SHOW, $galleries_only = false)
+    function countGalleryChildren($perm = Horde_Perms::SHOW, $galleries_only = false)
     {
         if (!$galleries_only && !$this->hasSubGalleries()) {
             return $this->_gallery->data['attribute_images'];
@@ -168,9 +168,9 @@ class Ansel_GalleryMode_Normal {
 
     function moveImagesTo($images, $gallery)
     {
-        if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             return PEAR::raiseError(sprintf(_("Access denied moving photos to \"%s\"."), $newGallery->get('name')));
-        } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+        } elseif (!$this->_gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
             return PEAR::raiseError(sprintf(_("Access denied removing photos from \"%s\"."), $gallery->get('name')));
         }
 
@@ -310,7 +310,7 @@ class Ansel_GalleryMode_Normal {
     {
         if ($subgalleries && $this->hasSubGalleries()) {
             $count = $this->countImages(false);
-            $galleries = $GLOBALS['ansel_storage']->listGalleries(PERMS_SHOW,
+            $galleries = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW,
                                                                   false,
                                                                   $this->_gallery,
                                                                   true);
index 9b51397..0e3d775 100644 (file)
@@ -935,7 +935,7 @@ class Ansel_Image
         if (is_a($gallery, 'PEAR_Error')) {
             return $gallery;
         }
-        if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             $res = Ansel_Tags::readTags($this->id);
             if (!is_a($res, 'PEAR_Error')) {
                 $this->_tags = $res;
@@ -958,7 +958,7 @@ class Ansel_Image
         global $ansel_storage;
 
         $gallery = $ansel_storage->getGallery(abs($this->gallery));
-        if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             // Clear the local cache.
             $this->_tags = array();
             return Ansel_Tags::writeTags($this->id, $tags);
index 576a56b..ece4c0e 100644 (file)
@@ -110,7 +110,7 @@ class Ansel_ImageView {
     function _getGalleryWithImages($parent)
     {
        $galleries = $GLOBALS['ansel_storage']->listGalleries(
-                                                    PERMS_SHOW,
+                                                    Horde_Perms::SHOW,
                                                     null,
                                                     $parent,
                                                     false);
index 6a4154f..0ea75d9 100644 (file)
@@ -184,10 +184,10 @@ class Ansel_Storage
             /* Default permissions for logged in users */
             switch ($GLOBALS['prefs']->getValue('default_permissions')) {
             case 'read':
-                $perms = PERMS_SHOW | PERMS_READ;
+                $perms = Horde_Perms::SHOW | Horde_Perms::READ;
                 break;
             case 'edit':
-                $perms = PERMS_SHOW | PERMS_READ | PERMS_EDIT;
+                $perms = Horde_Perms::SHOW | Horde_Perms::READ | Horde_Perms::EDIT;
                 break;
             case 'none':
                 $perms = 0;
@@ -198,7 +198,7 @@ class Ansel_Storage
             /* Default guest permissions */
             switch ($GLOBALS['prefs']->getValue('guest_permissions')) {
             case 'read':
-                $perms = PERMS_SHOW | PERMS_READ;
+                $perms = Horde_Perms::SHOW | Horde_Perms::READ;
                 break;
             case 'none':
             default:
@@ -210,13 +210,13 @@ class Ansel_Storage
             /* Default user groups permissions */
             switch ($GLOBALS['prefs']->getValue('group_permissions')) {
             case 'read':
-                $perms = PERMS_SHOW | PERMS_READ;
+                $perms = Horde_Perms::SHOW | Horde_Perms::READ;
                 break;
             case 'edit':
-                $perms = PERMS_SHOW | PERMS_READ | PERMS_EDIT;
+                $perms = Horde_Perms::SHOW | Horde_Perms::READ | Horde_Perms::EDIT;
                 break;
             case 'delete':
-                $perms = PERMS_SHOW | PERMS_READ | PERMS_EDIT | PERMS_DELETE;
+                $perms = Horde_Perms::SHOW | Horde_Perms::READ | Horde_Perms::EDIT | Horde_Perms::DELETE;
                 break;
             case 'none':
             default:
@@ -452,7 +452,7 @@ class Ansel_Storage
 
         /* See if we need to clear the has_subgalleries field */
         if ($parent instanceof Ansel_Gallery) {
-            if (!$parent->countChildren(PERMS_SHOW, false)) {
+            if (!$parent->countChildren(Horde_Perms::SHOW, false)) {
                 $parent->set('has_subgalleries', 0, true);
                 if ($GLOBALS['conf']['ansel_cache']['usecache']) {
                     $GLOBALS['cache']->expire('Ansel_Gallery' . $parent->id);
@@ -599,7 +599,7 @@ class Ansel_Storage
      *
      * @param array $galleries  An array of gallery ids to search in. If
      *                          left empty, will search all galleries
-     *                          with PERMS_SHOW.
+     *                          with Horde_Perms::SHOW.
      * @param integer $limit    The maximum number of images to return
      * @param string $slugs     An array of gallery slugs.
      * @param string $where     Additional where clause
@@ -697,7 +697,7 @@ class Ansel_Storage
     * @return array  List of categories
     * @throws Horde_Exception
     */
-    public function listCategories($perm = PERMS_SHOW, $from = 0, $count = 0)
+    public function listCategories($perm = Horde_Perms::SHOW, $from = 0, $count = 0)
     {
         $sql = 'SELECT DISTINCT attribute_category FROM '
                . $this->_shares->_table;
@@ -729,7 +729,7 @@ class Ansel_Storage
      *
      * @return int  The count of categories
      */
-    public function countCategories($perms = PERMS_SHOW)
+    public function countCategories($perms = Horde_Perms::SHOW)
     {
         return count($this->listCategories($perms));
     }
@@ -752,7 +752,7 @@ class Ansel_Storage
     * @return int  The count
     * @throws Horde_Exception
     */
-    public function countGalleries($userid, $perm = PERMS_SHOW, $attributes = null,
+    public function countGalleries($userid, $perm = Horde_Perms::SHOW, $attributes = null,
                             $parent = null, $allLevels = true)
     {
         static $counts;
@@ -804,7 +804,7 @@ class Ansel_Storage
     * @return array of Ansel_Gallery objects
     * @throws Horde_Exception
     */
-    public function listGalleries($perm = PERMS_SHOW,
+    public function listGalleries($perm = Horde_Perms::SHOW,
                            $attributes = null,
                            $parent = null,
                            $allLevels = true,
@@ -860,7 +860,7 @@ class Ansel_Storage
             // image will not be incldued in the output.
             if (!isset($galleries[$gallery_id]['perm'])) {
                 $galleries[$gallery_id]['perm'] =
-                    ($galleries[$gallery_id]['gallery']->hasPermission(Horde_Auth::getAuth(), PERMS_READ) &&
+                    ($galleries[$gallery_id]['gallery']->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) &&
                      $galleries[$gallery_id]['gallery']->isOldEnough() &&
                      !$galleries[$gallery_id]['gallery']->hasPasswd());
             }
@@ -904,7 +904,7 @@ class Ansel_Storage
      *
      * @see Ansel_Storage::listGalleries()
      */
-    public function getRandomGallery($perm = PERMS_SHOW, $attributes = null,
+    public function getRandomGallery($perm = Horde_Perms::SHOW, $attributes = null,
                               $parent = null, $allLevels = true)
     {
         $num_galleries = $this->countGalleries(Horde_Auth::getAuth(), $perm,
@@ -1026,7 +1026,7 @@ class Ansel_Storage
      */
     public function getRecentImagesGeodata($user = null, $start = 0, $count = 8)
     {
-        $galleries = $this->listGalleries('PERMS_EDIT', $user);
+        $galleries = $this->listGalleries('Horde_Perms::EDIT', $user);
         $where = 'gallery_id IN(' . implode(',', array_keys($galleries)) . ') AND LENGTH(image_latitude) > 0 GROUP BY image_latitude, image_longitude';
         return $this->listImages(0, $start, $count, array('image_id as id', 'image_id', 'gallery_id', 'image_latitude', 'image_longitude', 'image_location'), $where, 'image_geotag_date DESC');
     }
index ae2b85d..f29be24 100644 (file)
@@ -215,7 +215,7 @@ class Ansel_Tags {
                     $gal = $GLOBALS['ansel_storage']->getGallery($img->gallery);
                     if (!is_a($gal, 'PEAR_Error')) {
                         $owner = $gal->get('owner');
-                        if ($gal->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW) &&
+                        if ($gal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) &&
                             (!isset($user) || (isset($user) && $owner == $user))) {
                             $imgs[] = $id;
                         }
@@ -248,7 +248,7 @@ class Ansel_Tags {
                         Horde::logMessage($gallery, __FILE__, __LINE__, PEAR_LOG_ERR);
                         continue;
                     }
-                    if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)  && (!isset($user) || (isset($user) && $gallery->get('owner') == $user))) {
+                    if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)  && (!isset($user) || (isset($user) && $gallery->get('owner') == $user))) {
                         $results['galleries'][] = $id;
                     }
                 }
index 6b168dc..349cdff 100644 (file)
@@ -71,7 +71,7 @@ class Ansel_Tile_DateGallery {
         //$view = Horde_Util::getFormData('view', 'Gallery');
 
         /* Check permissions on the gallery and get appropriate tile image */
-        if ($dgallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        if ($dgallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             if (is_null($style)) {
                 $style = $dgallery->getStyle();
             }
index 33d760c..b6caba7 100644 (file)
@@ -41,7 +41,7 @@ class Ansel_Tile_Gallery {
         }
 
         /* Check gallery permissions and get appropriate tile image */
-        if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             if (is_null($style)) {
                 $style = $gallery->getStyle();
             }
@@ -86,7 +86,7 @@ class Ansel_Tile_Gallery {
         $text_link = $view_link . htmlspecialchars($gallery->get('name'), ENT_COMPAT, Horde_Nls::getCharset())
                      . '</a>';
 
-        if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT) && !$mini) {
+        if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT) && !$mini) {
             $properties_link = Horde_Util::addParameter(
                     Horde::applicationUrl('gallery.php', true),
                         array('gallery' => $gallery->id,
index d25a8f8..3b133a6 100644 (file)
@@ -92,8 +92,8 @@ class Ansel_Tile_Image {
         }
 
         $thumb_url = Ansel::getImageUrl($image->id, $thumbstyle, true, $style['name']);
-        $option_select = $parent->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE);
-        $option_edit = $parent->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+        $option_select = $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
+        $option_edit = $parent->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
         $imgAttributes = (!empty($params['image_view_attributes'])
                          ? $params['image_view_attributes'] : array());
 
@@ -112,7 +112,7 @@ class Ansel_Tile_Image {
         }
 
         ob_start();
-        // In-line caption editing if we have PERMS_EDIT
+        // In-line caption editing if we have Horde_Perms::EDIT
         if ($option_edit) {
             $imple = Horde_Ajax_Imple::factory(array('ansel', 'EditCaption'),
                                                array('id' => $image->id,
index a03a7d3..5423a7f 100644 (file)
@@ -88,7 +88,7 @@ abstract class Ansel_View_Base
         }
         if (is_a($gallery, 'PEAR_Error')) {
             throw new Horde_Exception($gallery->getMessage());
-        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        } elseif (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             throw new Horde_Exception(sprintf(_("Access denied to gallery \"%s\"."), $gallery->get('name')));
         }
 
index 20e027a..abb1176 100644 (file)
@@ -62,7 +62,7 @@ class Ansel_View_EmbeddedRenderer_GalleryLink extends Ansel_View_Gallery
                 Horde::logMessage($e->getMessage(), __FILE__, __LINE__, PEAR_LOG_ERR);
                 exit;
             }
-            if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+            if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
                 return '';
             }
 
index bc77bba..2d37688 100644 (file)
@@ -57,7 +57,7 @@ class Ansel_View_EmbeddedRenderer_Mini extends Ansel_View_Gallery
 
             // We don't allow age restricted or password locked galleries to be
             // viewed via the mini embedded view since it shows *all* the images
-            if (!$this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ) ||
+            if (!$this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) ||
                 !$this->gallery->isOldEnough() ||
                 $this->gallery->hasPasswd()) {
 
index b55dd22..c1d2e98 100644 (file)
@@ -127,7 +127,7 @@ class Ansel_View_Gallery extends Ansel_View_Base
             exit;
         }
 
-        if (!$this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        if (!$this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
             throw new Horde_Exception('Access denied viewing this gallery.');
         }
 
index 3a27993..76dbe47 100644 (file)
@@ -187,11 +187,11 @@ abstract class Ansel_View_GalleryRenderer_Base
     public function fetchChildren($noauto)
     {
         /* Total number of tiles for this gallery view */
-        $this->numTiles = $this->view->gallery->countGalleryChildren(PERMS_SHOW, false, $noauto);
+        $this->numTiles = $this->view->gallery->countGalleryChildren(Horde_Perms::SHOW, false, $noauto);
 
         /* Children to display on this page */
         $this->children = $this->view->gallery->getGalleryChildren(
-            PERMS_SHOW,
+            Horde_Perms::SHOW,
             $this->page * $this->perpage,
             $this->perpage,
             !empty($this->view->force_grouping));
index ac26969..51dd0dd 100644 (file)
@@ -40,10 +40,10 @@ class Ansel_View_GalleryRenderer_Gallery extends Ansel_View_GalleryRenderer_Base
 
         /* Only need these if not being called via the api */
         if (empty($this->view->api)) {
-            $option_edit = $this->view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
-            $option_select = $option_delete = $this->view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE);
-            $option_move = ($option_delete && $GLOBALS['ansel_storage']->countGalleries(PERMS_EDIT));
-            $option_copy = ($option_edit && $GLOBALS['ansel_storage']->countGalleries(PERMS_EDIT));
+            $option_edit = $this->view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+            $option_select = $option_delete = $this->view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
+            $option_move = ($option_delete && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
+            $option_copy = ($option_edit && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
             /* See if we requested a show_actions change */
             if (Horde_Util::getFormData('actionID', '') == 'show_actions') {
                 $prefs->setValue('show_actions', (int)!$prefs->getValue('show_actions'));
index f4b904d..6f4e104 100644 (file)
@@ -63,11 +63,11 @@ class Ansel_View_GalleryRenderer_GalleryLightbox extends Ansel_View_GalleryRende
         /* Don't bother if we are being called from the api */
         if (empty($this->view->api)) {
             $option_edit = $this->view->gallery->hasPermission(Horde_Auth::getAuth(),
-                                                         PERMS_EDIT);
+                                                         Horde_Perms::EDIT);
             $option_select = $option_delete = $this->view->gallery->hasPermission(
-                Horde_Auth::getAuth(), PERMS_DELETE);
-            $option_move = ($option_delete && $GLOBALS['ansel_storage']->countGalleries(PERMS_EDIT));
-            $option_copy = ($option_edit && $GLOBALS['ansel_storage']->countGalleries(PERMS_EDIT));
+                Horde_Auth::getAuth(), Horde_Perms::DELETE);
+            $option_move = ($option_delete && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
+            $option_copy = ($option_edit && $GLOBALS['ansel_storage']->countGalleries(Horde_Perms::EDIT));
             /* See if we requested a show_actions change (fallback for non-js) */
             if (Horde_Util::getFormData('actionID', '') == 'show_actions') {
                 $prefs->setValue('show_actions', (int)!$prefs->getValue('show_actions'));
index c6a6e76..8525684 100644 (file)
@@ -372,7 +372,7 @@ class Ansel_View_Image extends Ansel_View_Base
             $this->addWidget(Ansel_Widget::factory('Links', array()));
 
             /* In line caption editing */
-            if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                 $imple = Horde_Ajax_Imple::factory(array('ansel', 'EditCaption'),
                                                 array('id' => $this->resource->id,
                                                       'domid' => "Caption",
index 1dbc5d8..d256a35 100644 (file)
@@ -107,7 +107,7 @@ class Ansel_View_List extends Ansel_View_Base
                 $try = $ansel_storage->getGalleries($getThese);
                 $gallerylist = array();
                 foreach ($try as $id => $gallery) {
-                    if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
+                    if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
                         $gallerylist[$id] = $gallery;
                     }
                 }
@@ -159,7 +159,7 @@ class Ansel_View_List extends Ansel_View_Base
             }
 
             $num_galleries = $ansel_storage->countGalleries(
-                Horde_Auth::getAuth(), PERMS_SHOW, $filter, null, false);
+                Horde_Auth::getAuth(), Horde_Perms::SHOW, $filter, null, false);
             if (is_a($num_galleries, 'PEAR_Error')) {
                 return $num_galleries->getMessage();
             }
@@ -175,7 +175,7 @@ class Ansel_View_List extends Ansel_View_Base
                 $gallerylist = array();
             } else {
                 $gallerylist = $ansel_storage->listGalleries(
-                    PERMS_SHOW, $filter, null, false, $page * $galleries_perpage,
+                    Horde_Perms::SHOW, $filter, null, false, $page * $galleries_perpage,
                     $galleries_perpage, $sortby, $sortdir);
             }
 
index c968d70..46d186f 100644 (file)
@@ -78,7 +78,7 @@ class Ansel_View_Results extends Ansel_View_Base
                  // the image object to get the gallery.
                  $img = $ansel_storage->getImage($image);
                  $gallery = $ansel_storage->getgallery($img->gallery);
-                 if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+                 if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
                      $GLOBALS['notification']->push(
                         sprintf(_("Access denied deleting photos from \"%s\"."), $image),
                                 'horde.error');
@@ -260,7 +260,7 @@ class Ansel_View_Results extends Ansel_View_Base
                                                         'actionID' => 'add'));
 
         $vars = Horde_Variables::getDefaultVariables();
-        $option_move = $option_copy = $ansel_storage->countGalleries(PERMS_EDIT);
+        $option_move = $option_copy = $ansel_storage->countGalleries(Horde_Perms::EDIT);
 
 
         $pagestart = ($page * $perpage) + 1;
index 4cf72d9..62b6cff 100644 (file)
@@ -61,7 +61,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
             }
             $html .= '<li>' . Horde::link($slideshow_url, '', 'widget') . Horde::img('slideshow_play.png', _("Start Slideshow")) . ' ' . _("Start Slideshow") . '</a></li>';
         }
-        if (!empty($uploadurl) && $this->_view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (!empty($uploadurl) && $this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $html .= '<li>' . Horde::link($uploadurl, '', 'widget') . Horde::img('image_add.png') . ' ' . _("Upload photos") . '</a></li>';
 
             /* Subgalleries */
@@ -146,7 +146,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
         }
 
         /* Image upload, subgalleries, captions etc... */
-        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             /* Properties */
             $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, array('actionID' => 'modify', 'url' => $selfurl)), '', 'widget') . Horde::img('edit.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Change properties") . '</a></li>';
             if ($count) {
@@ -191,7 +191,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
             $html .= '<li>' . Horde::link($reporturl, '', 'widget') . ' ' . _("Report") . "</a></li>\n";
         }
 
-        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
             $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, 'actionID', 'empty'), '', 'widget') . Horde::img('delete.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Delete All Photos") . '</a></li>';
             $html .= '<li>' . Horde::link(Horde_Util::addParameter($galleryurl, 'actionID', 'delete'), '', 'widget') . Horde::img('delete.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Delete Entire Gallery") . '</a></li>';
         }
index ec880b7..4658897 100644 (file)
@@ -68,7 +68,7 @@ class Ansel_Widget_GalleryFaces extends Ansel_Widget_Base
         $images = $faces->getGalleryFaces($this->_view->resource->id);
 
 
-        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $link_text = (empty($images) ? _("Find faces") : _("Edit faces"));
             $html .= '<a id="edit_faces" href="' . Horde_Util::addParameter(Horde::applicationUrl('faces/gallery.php'), 'gallery', $this->_view->gallery->id)
                     . '" class="widget">' . $link_text . '</a>';
index 256dfce..c7eb413 100644 (file)
@@ -49,7 +49,7 @@ class Ansel_Widget_Geotag extends Ansel_Widget_Base
         $imple = Horde_Ajax_Imple::factory(array('ansel', 'ImageSaveGeotag'), array());
         $impleUrl = $imple->getUrl();
 
-        $permsEdit = $this->_view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+        $permsEdit = $this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
         $viewType = $this->_view->viewType();
 
         if (count($geodata) == 0 && $viewType != 'Image') {
index 81655a4..2c25a19 100644 (file)
@@ -63,7 +63,7 @@ class Ansel_Widget_ImageFaces extends Ansel_Widget_Base
         // back on going to the find all faces in gallery page if no js...
         // although, currently, *that* page requires js as well so...
         // TODO: A way to 'close', or go back to, the normal widget view.
-        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $link_text = (empty($images) ? _("Find faces") : _("Edit faces"));
             $html .= '<a id="edit_faces" href="' . Horde_Util::addParameter(Horde::applicationUrl('faces/gallery.php'), 'gallery', $this->_view->gallery->id)
                     . '" class="widget">' . $link_text . '</a> | '
index a210ba8..68c1387 100644 (file)
@@ -66,7 +66,7 @@ class Ansel_Widget_OtherGalleries extends Ansel_Widget_Base
         /* Set up the tree */
         $tree = Horde_Tree::singleton('otherAnselGalleries_' . md5($owner), 'javascript');
         $tree->setOption(array('class' => 'anselWidgets'));
-        $gals = $GLOBALS['ansel_storage']->listGalleries(PERMS_SHOW, $owner,
+        $gals = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, $owner,
                                                          null, true, 0, 0,
                                                          'name', 0);
 
index 58c3479..70b3296 100644 (file)
@@ -33,7 +33,7 @@ class Ansel_Widget_Tags extends Ansel_Widget_Base
         /* Build the tag widget */
         $html = $this->_htmlBegin();
         $html .= '<div id="tags">' . $this->_getTagHTML() . '</div>';
-        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if ($this->_view->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             ob_start();
             /* Attach the Ajax action */
             $imple = Horde_Ajax_Imple::factory(array('ansel', 'TagActions'),
@@ -71,7 +71,7 @@ class Ansel_Widget_Tags extends Ansel_Widget_Base
         }
 
         $hasEdit = $this->_view->gallery->hasPermission(Horde_Auth::getAuth(),
-                                                        PERMS_EDIT);
+                                                        Horde_Perms::EDIT);
         $owner = $this->_view->gallery->get('owner');
         $tags = $this->_view->resource->getTags();
         if (count($tags)) {
index 5e4b1b4..f071edf 100644 (file)
@@ -29,7 +29,7 @@ $gallery = $ansel_storage->getGallery($image->gallery);
 if (is_a($gallery, 'PEAR_Error')) {
     Horde::fatal(_("An error has occured retrieving the image. Details have been logged."), __FILE__, __LINE__, true);
 }
-if (!$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if (!$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     Horde::fatal(_("Not Authorized. Details have been logged for the server administrator."), __FILE__, __LINE__, true);
 }
 
index 29a0a88..1e79dad 100644 (file)
@@ -65,92 +65,92 @@ case 'editforminherit':
                 $share->set('owner', $new_owner);
                 $share->save();
                 if (Horde_Util::getFormData('owner_show')) {
-                    $perm->addUserPermission($new_owner, PERMS_SHOW, false);
+                    $perm->addUserPermission($new_owner, Horde_Perms::SHOW, false);
                 } else {
-                    $perm->removeUserPermission($new_owner, PERMS_SHOW, false);
+                    $perm->removeUserPermission($new_owner, Horde_Perms::SHOW, false);
                 }
                 if (Horde_Util::getFormData('owner_read')) {
-                    $perm->addUserPermission($new_owner, PERMS_READ, false);
+                    $perm->addUserPermission($new_owner, Horde_Perms::READ, false);
                 } else {
-                    $perm->removeUserPermission($new_owner, PERMS_READ, false);
+                    $perm->removeUserPermission($new_owner, Horde_Perms::READ, false);
                 }
                 if (Horde_Util::getFormData('owner_edit')) {
-                    $perm->addUserPermission($new_owner, PERMS_EDIT, false);
+                    $perm->addUserPermission($new_owner, Horde_Perms::EDIT, false);
                 } else {
-                    $perm->removeUserPermission($new_owner, PERMS_EDIT, false);
+                    $perm->removeUserPermission($new_owner, Horde_Perms::EDIT, false);
                 }
                 if (Horde_Util::getFormData('owner_delete')) {
-                    $perm->addUserPermission($new_owner, PERMS_DELETE, false);
+                    $perm->addUserPermission($new_owner, Horde_Perms::DELETE, false);
                 } else {
-                    $perm->removeUserPermission($new_owner, PERMS_DELETE, false);
+                    $perm->removeUserPermission($new_owner, Horde_Perms::DELETE, false);
                 }
             }
         }
 
         // Process default permissions.
         if (Horde_Util::getFormData('default_show')) {
-            $perm->addDefaultPermission(PERMS_SHOW, false);
+            $perm->addDefaultPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_SHOW, false);
+            $perm->removeDefaultPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('default_read')) {
-            $perm->addDefaultPermission(PERMS_READ, false);
+            $perm->addDefaultPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_READ, false);
+            $perm->removeDefaultPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('default_edit')) {
-            $perm->addDefaultPermission(PERMS_EDIT, false);
+            $perm->addDefaultPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_EDIT, false);
+            $perm->removeDefaultPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('default_delete')) {
-            $perm->addDefaultPermission(PERMS_DELETE, false);
+            $perm->addDefaultPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_DELETE, false);
+            $perm->removeDefaultPermission(Horde_Perms::DELETE, false);
         }
 
         // Process guest permissions.
         if (Horde_Util::getFormData('guest_show')) {
-            $perm->addGuestPermission(PERMS_SHOW, false);
+            $perm->addGuestPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeGuestPermission(PERMS_SHOW, false);
+            $perm->removeGuestPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('guest_read')) {
-            $perm->addGuestPermission(PERMS_READ, false);
+            $perm->addGuestPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeGuestPermission(PERMS_READ, false);
+            $perm->removeGuestPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('guest_edit')) {
-            $perm->addGuestPermission(PERMS_EDIT, false);
+            $perm->addGuestPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeGuestPermission(PERMS_EDIT, false);
+            $perm->removeGuestPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('guest_delete')) {
-            $perm->addGuestPermission(PERMS_DELETE, false);
+            $perm->addGuestPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeGuestPermission(PERMS_DELETE, false);
+            $perm->removeGuestPermission(Horde_Perms::DELETE, false);
         }
 
         // Process creator permissions.
         if (Horde_Util::getFormData('creator_show')) {
-            $perm->addCreatorPermission(PERMS_SHOW, false);
+            $perm->addCreatorPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_SHOW, false);
+            $perm->removeCreatorPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('creator_read')) {
-            $perm->addCreatorPermission(PERMS_READ, false);
+            $perm->addCreatorPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_READ, false);
+            $perm->removeCreatorPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('creator_edit')) {
-            $perm->addCreatorPermission(PERMS_EDIT, false);
+            $perm->addCreatorPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_EDIT, false);
+            $perm->removeCreatorPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('creator_delete')) {
-            $perm->addCreatorPermission(PERMS_DELETE, false);
+            $perm->addCreatorPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_DELETE, false);
+            $perm->removeCreatorPermission(Horde_Perms::DELETE, false);
         }
 
         // Process user permissions.
@@ -168,24 +168,24 @@ case 'editforminherit':
             }
 
             if (!empty($u_show[$key])) {
-                $perm->addUserPermission($user, PERMS_SHOW, false);
+                $perm->addUserPermission($user, Horde_Perms::SHOW, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_SHOW, false);
+                $perm->removeUserPermission($user, Horde_Perms::SHOW, false);
             }
             if (!empty($u_read[$key])) {
-                $perm->addUserPermission($user, PERMS_READ, false);
+                $perm->addUserPermission($user, Horde_Perms::READ, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_READ, false);
+                $perm->removeUserPermission($user, Horde_Perms::READ, false);
             }
             if (!empty($u_edit[$key])) {
-                $perm->addUserPermission($user, PERMS_EDIT, false);
+                $perm->addUserPermission($user, Horde_Perms::EDIT, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_EDIT, false);
+                $perm->removeUserPermission($user, Horde_Perms::EDIT, false);
             }
             if (!empty($u_delete[$key])) {
-                $perm->addUserPermission($user, PERMS_DELETE, false);
+                $perm->addUserPermission($user, Horde_Perms::DELETE, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_DELETE, false);
+                $perm->removeUserPermission($user, Horde_Perms::DELETE, false);
             }
         }
 
@@ -202,24 +202,24 @@ case 'editforminherit':
             }
 
             if (!empty($g_show[$key])) {
-                $perm->addGroupPermission($group, PERMS_SHOW, false);
+                $perm->addGroupPermission($group, Horde_Perms::SHOW, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_SHOW, false);
+                $perm->removeGroupPermission($group, Horde_Perms::SHOW, false);
             }
             if (!empty($g_read[$key])) {
-                $perm->addGroupPermission($group, PERMS_READ, false);
+                $perm->addGroupPermission($group, Horde_Perms::READ, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_READ, false);
+                $perm->removeGroupPermission($group, Horde_Perms::READ, false);
             }
             if (!empty($g_edit[$key])) {
-                $perm->addGroupPermission($group, PERMS_EDIT, false);
+                $perm->addGroupPermission($group, Horde_Perms::EDIT, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_EDIT, false);
+                $perm->removeGroupPermission($group, Horde_Perms::EDIT, false);
             }
             if (!empty($g_delete[$key])) {
-                $perm->addGroupPermission($group, PERMS_DELETE, false);
+                $perm->addGroupPermission($group, Horde_Perms::DELETE, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_DELETE, false);
+                $perm->removeGroupPermission($group, Horde_Perms::DELETE, false);
             }
         }
 
@@ -242,7 +242,7 @@ case 'editforminherit':
 if (is_a($share, 'PEAR_Error')) {
     $title = _("Edit Permissions");
 } else {
-    $children = $GLOBALS['ansel_storage']->listGalleries(PERMS_READ, false,
+    $children = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::READ, false,
                                                          $share);
     $title = sprintf(_("Edit Permissions for %s"), $share->get('name'));
 }
index 3760849..028b20a 100644 (file)
@@ -22,7 +22,7 @@ if (is_a($gal, 'PEAR_Error')) {
 }
 $img = Ansel::getImageUrl($imageId, 'thumb', false);
 if (!is_a($img, 'PEAR_Error') &&
-        $gal->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW) &&
+        $gal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) &&
         !$gal->hasPasswd() &&
         $gal->isOldEnough()) {
     echo '<img src="' . $img . '" alt="' . htmlspecialchars($image->filename) . '" />';
index 357cf6b..86ee3f3 100644 (file)
@@ -78,10 +78,10 @@ if (empty($rss)) {
             $gallery = $ansel_storage->getGallery($id);
         }
         if (!is_a($gallery, 'PEAR_Error') &&
-            $gallery->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW) &&
+            $gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW) &&
             !$gallery->hasPasswd() && $gallery->isOldEnough()) {
             if (!$gallery->countImages() && $gallery->hasSubGalleries()) {
-                $subgalleries = $ansel_storage->listGalleries(PERMS_SHOW,
+                $subgalleries = $ansel_storage->listGalleries(Horde_Perms::SHOW,
                                                               null,
                                                               $gallery);
                 $subs = array();
@@ -126,7 +126,7 @@ if (empty($rss)) {
         break;
 
     case 'user':
-        $shares = $ansel_storage->listGalleries(PERMS_SHOW, $id);
+        $shares = $ansel_storage->listGalleries(Horde_Perms::SHOW, $id);
         if (!is_a($shares, 'PEAR_Error')) {
             $galleries = array();
             foreach ($shares as $gallery) {
@@ -212,7 +212,7 @@ if (empty($rss)) {
             }
             if (!isset($galleries[$gallery_id]['perm'])) {
                 $galleries[$gallery_id]['perm'] =
-                    ($galleries[$gallery_id]['gallery']->hasPermission(Horde_Auth::getAuth(), PERMS_READ) &&
+                    ($galleries[$gallery_id]['gallery']->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) &&
                      $galleries[$gallery_id]['gallery']->isOldEnough() &&
                      !$galleries[$gallery_id]['gallery']->hasPasswd());
             }
index 9568c7e..51fcc0f 100755 (executable)
@@ -124,7 +124,7 @@ if (!empty($galleryId)) {
     } else {
         $gallery = $ansel_storage->getGallery($galleryId);
         if (is_a($gallery, 'PEAR_Error') ||
-            !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $error = sprintf(_("Access denied adding photos to \"%s\"."),
                              $galleryId);
             Horde::logMessage($error, __FILE__, __LINE__, PEAR_LOG_WARNING);
index 0aa22e5..44bd979 100755 (executable)
@@ -107,7 +107,7 @@ exit;
 function emptyGalleryCheck($gallery)
 {
     if ($gallery->hasSubGalleries()) {
-        $children = $GLOBALS['ansel_storage']->listGalleries(PERMS_SHOW, null, $gallery, false);
+        $children = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, null, $gallery, false);
         foreach ($children as $child) {
             // First check all children to see if they are empty...
             emptyGalleryCheck($child);
index 34c041b..9605713 100755 (executable)
@@ -121,7 +121,7 @@ processDirectory($dir, null, $gallery_id, $gallery_slug, $useCompression);
 function emptyGalleryCheck($gallery)
 {
     if ($gallery->hasSubGalleries()) {
-        $children = $GLOBALS['ansel_storage']->listGalleries(PERMS_SHOW, null, $gallery, false);
+        $children = $GLOBALS['ansel_storage']->listGalleries(Horde_Perms::SHOW, null, $gallery, false);
         foreach ($children as $child) {
             // First check all children to see if they are empty...
             emptyGalleryCheck($child);
index c75e264..aeb93c9 100644 (file)
@@ -18,7 +18,7 @@
  <td>
   <select name="gallery_parent" id="gallery_parent">
    <option value=""><?php echo _("Top Level Gallery") ?></option>
-   <?php echo Ansel::selectGalleries($gallery_parent, PERMS_EDIT, null, null, true, 0, 0, $galleryId) ?>
+   <?php echo Ansel::selectGalleries($gallery_parent, Horde_Perms::EDIT, null, null, true, 0, 0, $galleryId) ?>
   </select>
  </td>
 </tr>
index 8d6f908..6d68cf0 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 $num_galleries = $GLOBALS['ansel_storage']->countGalleries(
-    Horde_Auth::getAuth(), PERMS_SHOW, array('category' => $group), null, false);
+    Horde_Auth::getAuth(), Horde_Perms::SHOW, array('category' => $group), null, false);
 
 if (empty($group)) {
     $category_title = _("Unfiled");
@@ -21,10 +21,10 @@ $link = Horde::link($viewurl, $category_title, 'light');
 $preview_gallery = array();
 if ($num_galleries < 5) {
     $preview_gallery = $GLOBALS['ansel_storage']->listGalleries(
-                            PERMS_SHOW, array('category' => $group), null, false);
+                            Horde_Perms::SHOW, array('category' => $group), null, false);
 } else {
     $preview_gallery = $GLOBALS['ansel_storage']->listGalleries(
-                            PERMS_SHOW, array('category' => $group), null,
+                            Horde_Perms::SHOW, array('category' => $group), null,
                             false, rand(0, $num_galleries - 4), 4);
 }
 $mini_count = 0;
index d903fef..acc1b89 100644 (file)
@@ -25,14 +25,14 @@ $link = Horde::link(Ansel::getUrlFor('view', array('groupby' => $groupby,
                                                    'owner' => $group,
                                                    'view' => 'List')));
 
-$num_galleries = $ansel_storage->countGalleries(Horde_Auth::getAuth(), PERMS_SHOW,
+$num_galleries = $ansel_storage->countGalleries(Horde_Auth::getAuth(), Horde_Perms::SHOW,
                                                 $group, null, false);
 if ($num_galleries < 5) {
-    $mini_galleries = $ansel_storage->listGalleries(PERMS_SHOW,
+    $mini_galleries = $ansel_storage->listGalleries(Horde_Perms::SHOW,
                                                     $group, null, false);
 } else {
     $mini_galleries = $GLOBALS['ansel_storage']->listGalleries(
-        PERMS_SHOW, $group, null, false, rand(0, $num_galleries - 4), 4);
+        Horde_Perms::SHOW, $group, null, false, rand(0, $num_galleries - 4), 4);
 }
 $mini_galleries = array_values($mini_galleries);
 ?>
index 83c95cc..bd85408 100644 (file)
@@ -14,11 +14,11 @@ $image_url = Horde::applicationUrl(Horde_Util::addParameter($base_url, array('ac
 ?>
 <div class="control anselActions" style="text-align:center;">
 <?php
-if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     echo Horde::link(Horde::applicationUrl($save_url), _("Save Change"))
              . Horde::img('save.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Save Change") . '</a> ';
 }
-if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     echo Horde::link(Horde::applicationUrl($edit_url), _("Cancel Change"))
              . Horde::img('delete.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Cancel Change") . '</a>';
 }
index 4b0e848..1d24732 100644 (file)
@@ -17,11 +17,11 @@ $image_url = Horde::applicationUrl(Horde_Util::addParameter($base_url, array('ac
 ?>
 <div class="control anselActions" style="text-align:center;">
 <?php
-if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     echo Horde::link(Horde::applicationUrl($save_url), _("Save Change"))
              . Horde::img('save.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Save Change") . '</a> ';
 }
-if ($gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if ($gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     echo Horde::link(Horde::applicationUrl($edit_url), _("Cancel Change"))
              . Horde::img('delete.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Cancel Change") . '</a>';
 }
index ce6a38b..2020c55 100644 (file)
@@ -136,7 +136,7 @@ function downloadSelected()
     </td>
     <td align="right">
       <?php echo implode(' | ', $action_links); ?>
-      <select name="new_gallery"><option value="-1"><?php echo _("Selected photos to") ?></option><?php echo Ansel::selectGalleries(null, PERMS_EDIT) ?></select>
+      <select name="new_gallery"><option value="-1"><?php echo _("Selected photos to") ?></option><?php echo Ansel::selectGalleries(null, Horde_Perms::EDIT) ?></select>
       </td></tr></table>
     <?php endif; ?>
     <?php if (!$this->numTiles): ?>
index 1f48e34..6e99c6a 100644 (file)
@@ -164,7 +164,7 @@ function downloadSelected()
           <?php if ($option_copy): ?>
      |      <?php echo Horde::link('#', _("Copy"), 'widget', '', 'copySelected(); return false;') . _("Copy"); ?></a>
           <?php endif; ?>
-          <select name="new_gallery"><option value="-1"><?php echo _("Selected photos to") ?></option><?php echo Ansel::selectGalleries($this->galleryId, PERMS_EDIT) ?></select>
+          <select name="new_gallery"><option value="-1"><?php echo _("Selected photos to") ?></option><?php echo Ansel::selectGalleries($this->galleryId, Horde_Perms::EDIT) ?></select>
           </td></tr></table>
         <?php endif; ?>
      <?php if (!$this->numTiles): ?>
index ef5c965..37898d7 100644 (file)
@@ -54,12 +54,12 @@ function arrowHandler(e)
     <?php
         $needSeperator = false;
         $actionHTML = '';
-        if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT) && empty($this->_params['api'])) {
+        if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT) && empty($this->_params['api'])) {
             $needSeperator = true;
             $actionHTML .= Horde::link('#', '', '', '_blank', $this->_urls['prop_popup'] . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . '</a>';
             $actionHTML .= ' | ' . Horde::link($this->_urls['edit'], '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") . '</a>';
         }
-        if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE) && empty($this->_params['api'])) {
+        if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE) && empty($this->_params['api'])) {
             $actionHTML .= ' | ' . Horde::link($this->_urls['delete'], '', '', '', 'return window.confirm(\'' . addslashes(sprintf(_("Do you want to permanently delete ''%s''?"), $this->resource->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") . '</a>';
         }
         if (!empty($conf['ecard']['enable']) && !empty($this->_urls['ecard'])) {
index d5415eb..3cd88e9 100644 (file)
@@ -86,7 +86,7 @@ echo htmlspecialchars($this->getTitle(), ENT_COMPAT, Horde_Nls::getCharset()) .
 <?php if ($option_copy): ?>
  |  <?php echo Horde::link('#', _("Copy"), 'widget', '', 'copySelected(); return false;') . _("Copy"); ?></a>
 <?php endif; ?>
-    <select name="new_gallery"><option value="-1"><?php echo _("Selected photos to") ?></option><?php echo Ansel::selectGalleries(null, PERMS_EDIT) ?></select>
+    <select name="new_gallery"><option value="-1"><?php echo _("Selected photos to") ?></option><?php echo Ansel::selectGalleries(null, Horde_Perms::EDIT) ?></select>
   </td>
  </tr>
 </table>
index d9fe870..4dc3392 100644 (file)
@@ -13,11 +13,11 @@ function stopSlideShow()
 <table width="100%" cellspacing="0">
  <tr class="control">
   <td>
-    <?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)): ?>
+    <?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)): ?>
         <?php echo Horde::link('#', '', '', '_blank', 'SlideController.pause();' . $this->_urls['prop_popup'], '', '', array('id' => 'image_properties_link')) . _("Properties") ?></a>
       | <?php echo Horde::link(Horde::applicationUrl($this->_urls['edit']), '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") ?></a>
     <?php endif; ?>
-    <?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)): ?>
+    <?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)): ?>
       | <?php echo Horde::link($this->_urls['delete'], '', '', '', 'return window.confirm(\'' . addslashes(sprintf(_("Do you want to permanently delete \"%s\"?"), $this->resource->filename)) . '\');', '', '', array('id' => 'image_delete_link')) . _("Delete") ?></a>
     <?php endif; ?>
   </td>
index ccd1919..a3afc0d 100755 (executable)
@@ -11,7 +11,7 @@
  <p>
   <label style="font-weight:bold" for="gallery"><?php echo _("Existing galleries:") ?></label><br />
   <select id="gallery" name="gallery">
-   <?php echo Ansel::selectGalleries(null, PERMS_EDIT) ?>
+   <?php echo Ansel::selectGalleries(null, Horde_Perms::EDIT) ?>
   </select>
  </p>
  <p>
index 06ab476..9be94b5 100644 (file)
@@ -170,7 +170,7 @@ if ($cmd == 'add') {
         $error = _("Invalid gallery specified.") . "<br />\n";
     } else {
         $gallery = $ansel_storage->getGallery($galleryId);
-        if (is_a($gallery, 'PEAR_ERROR') || !$gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (is_a($gallery, 'PEAR_ERROR') || !$gallery->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $error = sprintf(_("Access denied adding photos to \"%s\"."), $gallery->get('name'));
         } else {
             $error = false;
index 23eded1..274bed1 100644 (file)
@@ -160,7 +160,7 @@ if (!$app) {
     $form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
 } else {
 
-    if (Babel::hasPermission('view', 'tabs', PERMS_EDIT)) {
+    if (Babel::hasPermission('view', 'tabs', Horde_Perms::EDIT)) {
        $hmenu_desc = _("Edit Header");
        $url = Horde::applicationUrl('edit.php');
        $url = Horde_Util::addParameter($url, array('module' => $app,
@@ -373,7 +373,7 @@ if (!$app) {
                $sfile = $m[1];
                $sline = $m[2];
 
-               if (Babel::hasPermission('viewsource', 'tabs', PERMS_EDIT)) {
+               if (Babel::hasPermission('viewsource', 'tabs', Horde_Perms::EDIT)) {
                    $surl = Horde::applicationUrl('viewsource.php');
                    $surl = Horde_Util::addParameter($surl, array('module' => $app,
                                                            'file'   => $sfile,
@@ -429,7 +429,7 @@ if (!$app) {
          if ($locked) {
              echo Horde::img('locked.png') . '&nbsp;' . sprintf(_("Locked by %s"), $locked);
          } else {
-             if (Babel::hasPermission('view', 'tabs', PERMS_EDIT)) {
+             if (Babel::hasPermission('view', 'tabs', Horde_Perms::EDIT)) {
                  if (!$editmode || $cstring != $encstr) {
                      $surl = Horde::applicationUrl('view.php');
                      $surl = Horde_Util::addParameter($surl, array('module' => $app, 'cstring' => $encstr, 'editmode' => 1, 'page' => $page, 'filter' => $filter, 'search' => $search));
index b60325a..c801fcf 100644 (file)
@@ -451,9 +451,9 @@ class Beatnik {
             return true;
         }
 
-        $perms = Perms::singleton();
+        $perms = Horde_Perms::singleton();
         if ($permmask === null) {
-            $permmask = PERMS_SHOW|PERMS_READ;
+            $permmask = Horde_Perms::SHOW|Horde_Perms::READ;
         }
 
         # Default deny all permissions
index 62e4e09..85d219d 100644 (file)
@@ -58,7 +58,7 @@ class Beatnik_Driver {
      *
      * @return array  Possibly empty array of domain information
      */
-    function getDomains($perms = PERMS_SHOW)
+    function getDomains($perms = Horde_Perms::SHOW)
     {
         $domains = $this->_getDomains();
         if (is_a($domains, 'PEAR_Error')) {
@@ -98,7 +98,7 @@ class Beatnik_Driver {
      */
     function getDomain($domainname)
     {
-        $domains = $this->getDomains(PERMS_SHOW | PERMS_READ);
+        $domains = $this->getDomains(Horde_Perms::SHOW | Horde_Perms::READ);
 
         foreach ($domains as $domain) {
             if ($domain['zonename'] == $domainname) {
@@ -203,7 +203,7 @@ class Beatnik_Driver {
         // Check to see if this is a new domain
         if ($info['rectype'] == 'soa' && $info['zonename'] != $_SESSION['beatnik']['curdomain']['zonename']) {
             // Make sure the user has permissions to add domains
-            if (!Beatnik::hasPermission('beatnik:domains', PERMS_EDIT)) {
+            if (!Beatnik::hasPermission('beatnik:domains', Horde_Perms::EDIT)) {
                 return PEAR::raiseError(_('You do not have permission to create new domains.'));
             }
 
@@ -216,12 +216,12 @@ class Beatnik_Driver {
             // Check for permissions to edit the record in question
             if ($info['rectype'] == 'soa') {
                 $node = 'beatnik:domains:' . $info['zonename'];
-                if (!Beatnik::hasPermission($node, PERMS_EDIT, 1)) {
+                if (!Beatnik::hasPermission($node, Horde_Perms::EDIT, 1)) {
                     return PEAR::raiseError(_('You do not have permssion to edit the SOA of this zone.'));
                 }
             } else {
                 $node = 'beatnik:domains:' . $_SESSION['beatnik']['curdomain']['zonename'] . ':' . $info['id'];
-                if (!Beatnik::hasPermission($node, PERMS_EDIT, 2)) {
+                if (!Beatnik::hasPermission($node, Horde_Perms::EDIT, 2)) {
                     return PEAR::raiseError(_('You do not have permssion to edit this record.'));
                 }
             }
index 39f1ea9..1cdbda2 100644 (file)
@@ -293,7 +293,7 @@ class Chora
     static public function checkPerms($key)
     {
         return (!$GLOBALS['perms']->exists('chora:sourceroots:' . $key) ||
-                $GLOBALS['perms']->hasPermission('chora:sourceroots:' . $key, Horde_Auth::getAuth(), PERMS_READ | PERMS_SHOW));
+                $GLOBALS['perms']->hasPermission('chora:sourceroots:' . $key, Horde_Auth::getAuth(), Horde_Perms::READ | Horde_Perms::SHOW));
     }
 
     /**
index c336e5b..38a6341 100644 (file)
@@ -69,7 +69,7 @@ case 'add_account':
 
 case 'modify_account':
     $account_id = $vars->get('account');
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(_("Access denied editing account."), 'horde.error');
     } else {
         $account = Fima::getAccount($account_id);
@@ -79,7 +79,7 @@ case 'modify_account':
             $vars = new Horde_Variables($account);
             $vars->set('actionID', 'save_account');
             $vars->set('number_new', $vars->get('number'));
-            $form = new Fima_AccountForm($vars, sprintf(_("Edit: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE));
+            $form = new Fima_AccountForm($vars, sprintf(_("Edit: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE));
             break;
         }
     }
@@ -102,7 +102,7 @@ case 'save_account':
     }
 
     $form->getInfo($vars, $info);
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied saving account to %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('accounts.php', true));
         exit;
@@ -171,7 +171,7 @@ case 'save_account':
 
 case 'delete_account':
     $account_id = $vars->get('account');
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
         $notification->push(_("Access denied deleting account."), 'horde.error');
     } else {
         $account = Fima::getAccount($account_id);
@@ -182,7 +182,7 @@ case 'delete_account':
             $vars->set('actionID', 'purge_account');
             $vars->set('dssubaccounts', array('type' => 'none', 'account' => $account_id));
             $vars->set('dspostings', array('type' => 'delete', 'account' => $account_id));
-            $form = new Fima_AccountDeleteForm($vars, sprintf(_("Delete: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT));
+            $form = new Fima_AccountDeleteForm($vars, sprintf(_("Delete: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT));
             break;
         }
     }
@@ -205,7 +205,7 @@ case 'purge_account':
     }
 
     $form->getInfo($vars, $info);
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
         $notification->push(sprintf(_("Access denied deleting account from %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('accounts.php', true));
         exit;
index 799320f..3e15e56 100644 (file)
@@ -25,7 +25,7 @@ if (is_a($share, 'PEAR_Error')) {
 $actionID = Horde_Util::getFormData('actionID');
 switch ($actionID) {
 case 'delete_all':
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
         $notification->push(_("Access denied deleting all accounts and postings."), 'horde.error');
     } else {
         $storage = &Fima_Driver::singleton($ledger);
index a7e3404..4b8fbac 100644 (file)
@@ -189,7 +189,7 @@ class Fima {
      *
      * @return array  The list of ledgers.
      */
-    function listLedgers($owneronly = false, $permission = PERMS_SHOW)
+    function listLedgers($owneronly = false, $permission = Horde_Perms::SHOW)
     {
         $ledgers = $GLOBALS['fima_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null);
         if (is_a($ledgers, 'PEAR_Error')) {
@@ -203,7 +203,7 @@ class Fima {
     /**
      * Returns the active ledger for the current user.
      */
-    function getActiveLedger($permission = PERMS_SHOW)
+    function getActiveLedger($permission = Horde_Perms::SHOW)
     {
         global $prefs;
 
@@ -711,7 +711,7 @@ class Fima {
                 $GLOBALS['display_ledgers'] = array_keys($ledgers);
             } else {
                 /* Make sure at least the active ledger is visible. */
-                $active_ledger = Fima::getActiveLedger(PERMS_READ);
+                $active_ledger = Fima::getActiveLedger(Horde_Perms::READ);
                 if ($active_ledger) {
                     $GLOBALS['display_ledgers'] = array($active_ledger);
                 }
index 75804ec..9370b37 100644 (file)
@@ -169,7 +169,7 @@ case 'save_postings':
     $postingset = Horde_Util::getFormData('posting_id');
 
     $share = &$GLOBALS['fima_shares']->getShare($ledger);
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied saving postings to %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('postings.php', true));
         exit;
@@ -284,7 +284,7 @@ case 'delete_postings':
     $postingset = Horde_Util::getFormData('indices');
 
     $share = &$GLOBALS['fima_shares']->getShare($ledger);
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
         $notification->push(sprintf(_("Access denied deleting postings from %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('postings.php', true));
         exit;
@@ -315,7 +315,7 @@ case 'update_postings':
     $postingset = Horde_Util::getFormData('posting_id');
 
     $share = &$GLOBALS['fima_shares']->getShare($ledger);
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied shifting postings in %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('postings.php', true));
         exit;
@@ -350,11 +350,11 @@ case 'update_postings':
 
 case 'copymove_postings':
     $share = &$GLOBALS['fima_shares']->getShare($ledger);
-    if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('postings.php', true));
         exit;
-    } elseif (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE) && (!Horde_Util::getFormData('keep') || Horde_Util::getFormData('delete'))) {
+    } elseif (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE) && (!Horde_Util::getFormData('keep') || Horde_Util::getFormData('delete'))) {
         $notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('postings.php', true));
         exit;
index fe0346c..de1dc29 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
-$perm_edit = $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
-$perm_delete = $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE);
+$perm_edit = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+$perm_delete = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
 
 ?>
 <script type="text/javascript">
index 70aa43c..a065650 100644 (file)
@@ -35,7 +35,7 @@ class Folks_Hooks
             return count($result);
 
         case 'galleries':
-            return $GLOBALS['registry']->callByPackage('ansel', 'countGalleries', array('ansel', PERMS_SHOW, $user));
+            return $GLOBALS['registry']->callByPackage('ansel', 'countGalleries', array('ansel', Horde_Perms::SHOW, $user));
 
         case 'blogs':
             return $GLOBALS['registry']->callByPackage('thomas', 'countPosts', array(array('user' => $user)));
@@ -125,7 +125,7 @@ class Folks_Hooks
             return $GLOBALS['registry']->callByPackage('genie', 'listUserItems', array($user));
 
         case 'galleries':
-            return $GLOBALS['registry']->callByPackage('ansel', 'listGalleries', array('ansel', PERMS_SHOW, null, true, 0, 3, $user));
+            return $GLOBALS['registry']->callByPackage('ansel', 'listGalleries', array('ansel', Horde_Perms::SHOW, null, true, 0, 3, $user));
 
         case 'blogs':
             return $GLOBALS['registry']->callByPackage('thomas', 'getRecentPosts', array($user, Horde_Auth::getAuth(), '', 3));
index 6238795..de6d41c 100644 (file)
@@ -486,7 +486,7 @@ class Folks_Driver {
         // Delete groups
         if ($GLOBALS['conf']['friends']) {
             $shares = Horde_Share::singleton('folks');
-            $groups = $shares->listShares(Horde_Auth::getAuth(), PERMS_SHOW, true);
+            $groups = $shares->listShares(Horde_Auth::getAuth(), Horde_Perms::SHOW, true);
             foreach ($groups as $share) {
                 $result = $shares->removeShare($share);
                 if ($result instanceof PEAR_Error) {
index f5e9883..74b7507 100644 (file)
@@ -59,7 +59,7 @@ class Folks_Friends_shared extends  Folks_Friends_sql {
     {
         $GLOBALS['folks_shares'] = Horde_Share::singleton('folks');
 
-        $groups = $GLOBALS['folks_shares']->listShares($this->_user, PERMS_READ);
+        $groups = $GLOBALS['folks_shares']->listShares($this->_user, Horde_Perms::READ);
         if ($groups instanceof PEAR_Error) {
             return $groups;
         }
index 710ec9a..8e7fb4a 100644 (file)
@@ -169,7 +169,7 @@ class Folks_Notification {
             if ($permission instanceof PEAR_Error) {
                 return $permission;
             } else {
-                $admins = $permission->getUserPermissions(PERMS_DELETE);
+                $admins = $permission->getUserPermissions(Horde_Perms::DELETE);
                 if ($admins instanceof PEAR_Error) {
                     return $admins;
                 }
index 212fcbe..928ff9d 100644 (file)
@@ -60,68 +60,68 @@ case 'editform':
 
         // Process default permissions.
         if (Horde_Util::getFormData('default_show')) {
-            $perm->addDefaultPermission(PERMS_SHOW, false);
+            $perm->addDefaultPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_SHOW, false);
+            $perm->removeDefaultPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('default_read')) {
-            $perm->addDefaultPermission(PERMS_READ, false);
+            $perm->addDefaultPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_READ, false);
+            $perm->removeDefaultPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('default_edit')) {
-            $perm->addDefaultPermission(PERMS_EDIT, false);
+            $perm->addDefaultPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_EDIT, false);
+            $perm->removeDefaultPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('default_delete')) {
-            $perm->addDefaultPermission(PERMS_DELETE, false);
+            $perm->addDefaultPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_DELETE, false);
+            $perm->removeDefaultPermission(Horde_Perms::DELETE, false);
         }
 
         // Process guest permissions.
         if (Horde_Util::getFormData('guest_show')) {
-            $perm->addGuestPermission(PERMS_SHOW, false);
+            $perm->addGuestPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeGuestPermission(PERMS_SHOW, false);
+            $perm->removeGuestPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('guest_read')) {
-            $perm->addGuestPermission(PERMS_READ, false);
+            $perm->addGuestPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeGuestPermission(PERMS_READ, false);
+            $perm->removeGuestPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('guest_edit')) {
-            $perm->addGuestPermission(PERMS_EDIT, false);
+            $perm->addGuestPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeGuestPermission(PERMS_EDIT, false);
+            $perm->removeGuestPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('guest_delete')) {
-            $perm->addGuestPermission(PERMS_DELETE, false);
+            $perm->addGuestPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeGuestPermission(PERMS_DELETE, false);
+            $perm->removeGuestPermission(Horde_Perms::DELETE, false);
         }
 
         // Process creator permissions.
         if (Horde_Util::getFormData('creator_show')) {
-            $perm->addCreatorPermission(PERMS_SHOW, false);
+            $perm->addCreatorPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_SHOW, false);
+            $perm->removeCreatorPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('creator_read')) {
-            $perm->addCreatorPermission(PERMS_READ, false);
+            $perm->addCreatorPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_READ, false);
+            $perm->removeCreatorPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('creator_edit')) {
-            $perm->addCreatorPermission(PERMS_EDIT, false);
+            $perm->addCreatorPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_EDIT, false);
+            $perm->removeCreatorPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('creator_delete')) {
-            $perm->addCreatorPermission(PERMS_DELETE, false);
+            $perm->addCreatorPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_DELETE, false);
+            $perm->removeCreatorPermission(Horde_Perms::DELETE, false);
         }
 
         // Process user permissions.
@@ -141,24 +141,24 @@ case 'editform':
             }
 
             if (!empty($u_show[$key])) {
-                $perm->addUserPermission($user, PERMS_SHOW, false);
+                $perm->addUserPermission($user, Horde_Perms::SHOW, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_SHOW, false);
+                $perm->removeUserPermission($user, Horde_Perms::SHOW, false);
             }
             if (!empty($u_read[$key])) {
-                $perm->addUserPermission($user, PERMS_READ, false);
+                $perm->addUserPermission($user, Horde_Perms::READ, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_READ, false);
+                $perm->removeUserPermission($user, Horde_Perms::READ, false);
             }
             if (!empty($u_edit[$key])) {
-                $perm->addUserPermission($user, PERMS_EDIT, false);
+                $perm->addUserPermission($user, Horde_Perms::EDIT, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_EDIT, false);
+                $perm->removeUserPermission($user, Horde_Perms::EDIT, false);
             }
             if (!empty($u_delete[$key])) {
-                $perm->addUserPermission($user, PERMS_DELETE, false);
+                $perm->addUserPermission($user, Horde_Perms::DELETE, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_DELETE, false);
+                $perm->removeUserPermission($user, Horde_Perms::DELETE, false);
             }
         }
 
@@ -175,24 +175,24 @@ case 'editform':
             }
 
             if (!empty($g_show[$key])) {
-                $perm->addGroupPermission($group, PERMS_SHOW, false);
+                $perm->addGroupPermission($group, Horde_Perms::SHOW, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_SHOW, false);
+                $perm->removeGroupPermission($group, Horde_Perms::SHOW, false);
             }
             if (!empty($g_read[$key])) {
-                $perm->addGroupPermission($group, PERMS_READ, false);
+                $perm->addGroupPermission($group, Horde_Perms::READ, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_READ, false);
+                $perm->removeGroupPermission($group, Horde_Perms::READ, false);
             }
             if (!empty($g_edit[$key])) {
-                $perm->addGroupPermission($group, PERMS_EDIT, false);
+                $perm->addGroupPermission($group, Horde_Perms::EDIT, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_EDIT, false);
+                $perm->removeGroupPermission($group, Horde_Perms::EDIT, false);
             }
             if (!empty($g_delete[$key])) {
-                $perm->addGroupPermission($group, PERMS_DELETE, false);
+                $perm->addGroupPermission($group, Horde_Perms::DELETE, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_DELETE, false);
+                $perm->removeGroupPermission($group, Horde_Perms::DELETE, false);
             }
         }
 
index 7bf67f6..d291391 100644 (file)
@@ -57,7 +57,7 @@ class Horde_Service_Facebook_Auth
     const EXTEND_PERMS_UPLOADPHOTO = 'photo_upload';
 
     const EXTEND_PERMS_PUBLISHSTREAM = 'publish_stream';
-    const EXTEND_PERMS_READSTREAM = 'read_stream';
+    const EXTEND_Horde_Perms::READSTREAM = 'read_stream';
 
 
 
index d3a5377..ea0e53d 100644 (file)
@@ -43,7 +43,7 @@ class Gollem_Api extends Horde_Registry_Api
             // We are at the root of gollem.  Return a set of folders, one for
             // each backend available.
             foreach ($backends as $backend => $curBackend) {
-                if (Gollem::checkPermissions('backend', PERMS_SHOW, $backend)) {
+                if (Gollem::checkPermissions('backend', Horde_Perms::SHOW, $backend)) {
                     $results['gollem/' . $backend]['name'] = $curBackend['name'];
                     $results['gollem/' . $backend]['browseable'] = true;
                 }
@@ -70,7 +70,7 @@ class Gollem_Api extends Horde_Registry_Api
             if (!Gollem_Session::createSession($backend_key)) {
                 return PEAR::raiseError(_("Unable to create Gollem session"));
             }
-            if (!Gollem::checkPermissions('backend', PERMS_READ)) {
+            if (!Gollem::checkPermissions('backend', Horde_Perms::READ)) {
                 return PEAR::raiseError(_("Permission denied to this backend."));
             }
 
@@ -184,7 +184,7 @@ class Gollem_Api extends Horde_Registry_Api
             if (!Gollem_Session::createSession($backend_key)) {
                 return PEAR::raiseError(_("Unable to create Gollem session"));
             }
-            if (!Gollem::checkPermissions('backend', PERMS_EDIT)) {
+            if (!Gollem::checkPermissions('backend', Horde_Perms::EDIT)) {
                 return PEAR::raiseError(_("Permission denied to this backend."));
             }
 
@@ -244,7 +244,7 @@ class Gollem_Api extends Horde_Registry_Api
             if (!Gollem_Session::createSession($backend_key)) {
                 return PEAR::raiseError(_("Unable to create Gollem session"));
             }
-            if (!Gollem::checkPermissions('backend', PERMS_EDIT)) {
+            if (!Gollem::checkPermissions('backend', Horde_Perms::EDIT)) {
                 return PEAR::raiseError(_("Permission denied to this backend."));
             }
 
@@ -317,7 +317,7 @@ class Gollem_Api extends Horde_Registry_Api
             if (!Gollem_Session::createSession($backend_key)) {
                 return PEAR::raiseError(_("Unable to create Gollem session"));
             }
-            if (!Gollem::checkPermissions('backend', PERMS_EDIT)) {
+            if (!Gollem::checkPermissions('backend', Horde_Perms::EDIT)) {
                 return PEAR::raiseError(_("Permission denied to this backend."));
             }
 
@@ -378,7 +378,7 @@ class Gollem_Api extends Horde_Registry_Api
             if (!Gollem_Session::createSession($backend_key)) {
                 return PEAR::raiseError(_("Unable to create Gollem session"));
             }
-            if (!Gollem::checkPermissions('backend', PERMS_EDIT)) {
+            if (!Gollem::checkPermissions('backend', Horde_Perms::EDIT)) {
                 return PEAR::raiseError(_("Permission denied to this backend."));
             }
 
index 8c34c22..34659f4 100644 (file)
@@ -33,7 +33,7 @@ class Horde_Block_gollem_tree_menu extends Horde_Block {
         $login_url = Horde::applicationUrl('login.php');
 
         foreach ($GLOBALS['gollem_backends'] as $key => $val) {
-            if (Gollem::checkPermissions('backend', PERMS_SHOW, $key)) {
+            if (Gollem::checkPermissions('backend', Horde_Perms::SHOW, $key)) {
                 $tree->addNode($parent . $key,
                                $parent,
                                $val['name'],
index c7d663a..14272fe 100644 (file)
@@ -694,7 +694,7 @@ class Gollem
      * @return boolean  Returns true if the user has permission, false if
      *                  they do not.
      */
-    static public function checkPermissions($filter, $permission = PERMS_READ,
+    static public function checkPermissions($filter, $permission = Horde_Perms::READ,
                                             $backend = null)
     {
         $userID = Horde_Auth::getAuth();
@@ -839,7 +839,7 @@ class Gollem
             require GOLLEM_BASE . '/config/backends.php';
             $GLOBALS['gollem_backends'] = array();
             foreach ($backends as $key => $val) {
-                if (Gollem::checkPermissions('backend', PERMS_SHOW, $key)) {
+                if (Gollem::checkPermissions('backend', Horde_Perms::SHOW, $key)) {
                     $GLOBALS['gollem_backends'][$key] = $val;
                 }
             }
index 6a9fdaa..de8986d 100644 (file)
@@ -20,9 +20,9 @@ $backkey = $_SESSION['gollem']['backend_key'];
 $old_dir = Gollem::getDir();
 
 /* Get permissions. */
-$delete_perms = Gollem::checkPermissions('backend', PERMS_DELETE);
-$edit_perms = Gollem::checkPermissions('backend', PERMS_EDIT);
-$read_perms = Gollem::checkPermissions('backend', PERMS_READ);
+$delete_perms = Gollem::checkPermissions('backend', Horde_Perms::DELETE);
+$edit_perms = Gollem::checkPermissions('backend', Horde_Perms::EDIT);
+$read_perms = Gollem::checkPermissions('backend', Horde_Perms::READ);
 
 /* Set directory. */
 if (is_a($result = Gollem::changeDir(), 'PEAR_Error')) {
index 6bb2c0f..a0430c9 100644 (file)
@@ -109,7 +109,7 @@ if ($GLOBALS['conf']['backend']['backend_list'] == 'shown') {
 
 if (is_array($list) &&
     count($list) &&
-    Gollem::checkPermissions('backend', PERMS_READ)) {
+    Gollem::checkPermissions('backend', Horde_Perms::READ)) {
 
     $entry = $icon_cache = array();
     $rowct = 0;
index 9474b15..8488dbb 100644 (file)
@@ -52,7 +52,7 @@ IMP_Dimp::header('', $scripts);
 $application_folders = array();
 foreach (IMP_Dimp::menuList() as $app) {
     if ($registry->get('status', $app) != 'inactive' &&
-        $registry->hasPermission($app, PERMS_SHOW)) {
+        $registry->hasPermission($app, Horde_Perms::SHOW)) {
         $application_folders[] = array(
             'name' => htmlspecialchars($registry->get('name', $app)),
             'icon' => $registry->get('icon', $app),
index 01b1ed1..4fbe0a6 100644 (file)
@@ -253,7 +253,7 @@ class IMP
         if (!empty($options['inc_tasklists']) &&
             !empty($_SESSION['imp']['tasklistavail'])) {
             try {
-                $tasklists = $GLOBALS['registry']->call('tasks/listTasklists', array(false, PERMS_EDIT));
+                $tasklists = $GLOBALS['registry']->call('tasks/listTasklists', array(false, Horde_Perms::EDIT));
 
                 if (count($tasklists)) {
                     $text .= '<option value="" disabled="disabled">&nbsp;</option><option value="" disabled="disabled">- - ' . _("Task Lists") . ' - -</option>' . "\n";
@@ -272,7 +272,7 @@ class IMP
         if (!empty($options['inc_notepads']) &&
             !empty($_SESSION['imp']['notepadavail'])) {
             try {
-                $notepads = $GLOBALS['registry']->call('notes/listNotepads', array(false, PERMS_EDIT));
+                $notepads = $GLOBALS['registry']->call('notes/listNotepads', array(false, Horde_Perms::EDIT));
                 if (count($notepads)) {
                     $text .= '<option value="" disabled="disabled">&nbsp;</option><option value="" disabled="disabled">- - ' . _("Notepads") . " - -</option>\n";
 
index 3821c48..1195139 100644 (file)
@@ -377,7 +377,7 @@ class IMP_Message
 
                     /* Get the list of editable tasklists. */
                     try {
-                        $lists = $registry->call('tasks/listTasklists', array(false, PERMS_EDIT));
+                        $lists = $registry->call('tasks/listTasklists', array(false, Horde_Perms::EDIT));
                     } catch (Horde_Exception $e) {
                         $lists = null;
                         $notification->push($e, $e->getCode());
@@ -401,7 +401,7 @@ class IMP_Message
 
                     /* Get the list of editable notepads. */
                     try {
-                        $lists = $registry->call('notes/listNotepads', array(false, PERMS_EDIT));
+                        $lists = $registry->call('notes/listNotepads', array(false, Horde_Perms::EDIT));
                     } catch (Horde_Exception $e) {
                         $lists = null;
                         $notification->push($e, $e->getCode());
index 59e5739..4894a74 100644 (file)
@@ -52,7 +52,7 @@ $t->set('muid', htmlspecialchars($muid));
 $t->set('image_img', Horde::img('mime/image.png', _("Image"), null, $registry->getImageDir('horde')));
 
 /* Build the list of galleries. */
-$t->set('gallerylist', $registry->call('images/selectGalleries', array(null, PERMS_EDIT)));
+$t->set('gallerylist', $registry->call('images/selectGalleries', array(null, Horde_Perms::EDIT)));
 
 $title = _("Save Image");
 require IMP_TEMPLATES . '/common-header.inc';
index 3de6d60..6505d76 100644 (file)
@@ -29,8 +29,8 @@ $actionID = Horde_Util::getFormData('actionID');
 $id = Horde_Util::getFormData('rulenumber');
 
 /* Get permissions. */
-$edit_allowed = Ingo::hasPermission('shares', PERMS_EDIT);
-$delete_allowed = Ingo::hasPermission('shares', PERMS_DELETE);
+$edit_allowed = Ingo::hasPermission('shares', Horde_Perms::EDIT);
+$delete_allowed = Ingo::hasPermission('shares', Horde_Perms::DELETE);
 
 /* Perform requested actions. */
 switch ($actionID) {
index 55f7bd2..b258e96 100644 (file)
@@ -98,7 +98,7 @@ class Ingo_Application extends Horde_Registry_Application
 
             /* Get a list of all shares this user owns and has perms to delete
              * and remove them. */
-            $shares = $GLOBALS['ingo_shares']->listShares($user, PERMS_DELETE, $user);
+            $shares = $GLOBALS['ingo_shares']->listShares($user, Horde_Perms::DELETE, $user);
             if (is_a($shares, 'PEAR_Error')) {
                 Horde::logMessage($shares, __FILE__, __LINE__, PEAR_LOG_ERR);
                 return $shares;
index c5bfd1a..a91f4fa 100644 (file)
@@ -314,7 +314,7 @@ class Ingo
      * @return array  The ruleset list.
      */
     static public function listRulesets($owneronly = false,
-                                        $permission = PERMS_SHOW)
+                                        $permission = Horde_Perms::SHOW)
     {
         $rulesets = $GLOBALS['ingo_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null);
         if (is_a($rulesets, 'PEAR_Error')) {
index e21cb4b..3455e8e 100644 (file)
@@ -83,7 +83,7 @@ if ($driver->supportShares()) {
     $_SESSION['ingo']['current_share'] = Horde_Util::getFormData('ruleset', @$_SESSION['ingo']['current_share']);
     if (empty($_SESSION['ingo']['current_share']) ||
         empty($GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]) ||
-        !$GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        !$GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
         $_SESSION['ingo']['current_share'] = $signature;
     }
 } else {
index 2a00114..0602a42 100644 (file)
@@ -50,7 +50,7 @@ case 'create_folder':
 case 'rule_save':
 case 'rule_update':
 case 'rule_delete':
-    if (!Ingo::hasPermission('shares', PERMS_EDIT)) {
+    if (!Ingo::hasPermission('shares', Horde_Perms::EDIT)) {
         $notification->push(_("You do not have permission to edit filter rules."), 'horde.error');
         header('Location: ' . Horde::applicationUrl('filters.php', true));
         exit;
@@ -145,7 +145,7 @@ case 'rule_delete':
         header('Location: ' . Horde::applicationUrl('filters.php'));
         exit;
     } elseif ($actionID == 'rule_delete') {
-        if (!Ingo::hasPermission('shares', PERMS_DELETE)) {
+        if (!Ingo::hasPermission('shares', Horde_Perms::DELETE)) {
             $notification->push(_("You do not have permission to delete filter rules."), 'horde.error');
             header('Location: ' . Horde::applicationUrl('filters.php', true));
             exit;
@@ -159,7 +159,7 @@ case 'rule_delete':
     break;
 
 default:
-    if (!Ingo::hasPermission('shares', PERMS_EDIT)) {
+    if (!Ingo::hasPermission('shares', Horde_Perms::EDIT)) {
         $notification->push(_("You do not have permission to edit filter rules."), 'horde.error');
         header('Location: ' . Horde::applicationUrl('filters.php', true));
         exit;
index ebc0b59..9f79b15 100755 (executable)
@@ -25,8 +25,8 @@ require(KASTALIA_BASE . '/config/conf.php');
 
 echo Horde_Auth::getAuth();
 
-echo $registry->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
-if($registry->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+echo $registry->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+if($registry->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
    echo "TASTA";
    exit(0);
 }
index ba4195d..7569157 100644 (file)
@@ -52,9 +52,6 @@ class Koward {
     {
         global $registry, $notification, $browser;
 
-        /* Horde core classes that aren't autoloaded. */
-        include_once 'Horde/Perms.php';
-
         $registry = Horde_Registry::singleton();
 
         $notification = Horde_Notification::singleton();
index 960e682..8119db4 100644 (file)
@@ -20,10 +20,10 @@ if (!Horde_Util::getFormData('cancel')) {
     if (is_a($share, 'PEAR_Error')) {
         $notification->push(sprintf(_("There was an error accessing the calendar: %s"), $share->getMessage()), 'horde.error');
     } elseif ($user != Horde_Auth::getAuth() &&
-              !$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELEGATE, Horde_Auth::getAuth())) {
+              !$share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE, Horde_Auth::getAuth())) {
         $notification->push(sprintf(_("You do not have permission to delegate events to %s."), Kronolith::getUserName($user)), 'horde.warning');
     } elseif ($user == Horde_Auth::getAuth() &&
-              !$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT, Horde_Auth::getAuth())) {
+              !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, Horde_Auth::getAuth())) {
         $notification->push(sprintf(_("You do not have permission to add events to %s."), $share->get('name')), 'horde.warning');
     } elseif (Kronolith::hasPermission('max_events') === true ||
               Kronolith::hasPermission('max_events') > Kronolith::countEvents()) {
index 953096c..1a0a8e6 100644 (file)
@@ -19,7 +19,7 @@ function getDriver($cal)
     switch ($driver) {
     case 'internal':
         if (!array_key_exists($calendar,
-                              Kronolith::listCalendars(false, PERMS_SHOW))) {
+                              Kronolith::listCalendars(false, Horde_Perms::SHOW))) {
             $GLOBALS['notification']->push(_("Permission Denied"), 'horde.error');
             return false;
         }
@@ -158,7 +158,7 @@ try {
             $notification->push(_("The requested event was not found."), 'horde.error');
             break;
         }
-        if (!$event->hasPermission(PERMS_EDIT)) {
+        if (!$event->hasPermission(Horde_Perms::EDIT)) {
             $notification->push(_("You do not have permission to edit this event."), 'horde.warning');
             break;
         }
@@ -170,7 +170,7 @@ try {
         $kronolith_driver = Kronolith::getDriver();
         try {
             $event = Kronolith::quickAdd(Horde_Util::getFormData('text'),
-                                         Kronolith::getDefaultCalendar(PERMS_EDIT));
+                                         Kronolith::getDefaultCalendar(Horde_Perms::EDIT));
             if (is_a($event, 'PEAR_Error')) {
                 $notification->push($event, 'horde.error');
                 break;
@@ -197,7 +197,7 @@ try {
             $notification->push(_("The requested event was not found."), 'horde.error');
             break;
         }
-        if (!$event->hasPermission(PERMS_EDIT)) {
+        if (!$event->hasPermission(Horde_Perms::EDIT)) {
             $notification->push(_("You do not have permission to edit this event."), 'horde.warning');
             break;
         }
@@ -256,7 +256,7 @@ try {
             $notification->push(_("The requested event was not found."), 'horde.error');
             break;
         }
-        if (!$event->hasPermission(PERMS_DELETE)) {
+        if (!$event->hasPermission(Horde_Perms::DELETE)) {
             $notification->push(_("You do not have permission to delete this event."), 'horde.warning');
             break;
         }
index 627b2f7..c7c535f 100644 (file)
@@ -194,7 +194,7 @@ if (!$error) {
             if (is_a($share, 'PEAR_Error')) {
                 $notification->push(_("You have specified an invalid calendar."), 'horde.error');
                 $next_step = $data->cleanup();
-            } elseif (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            } elseif (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                 $notification->push(_("You do not have permission to add events to the selected calendar."), 'horde.error');
                 $next_step = $data->cleanup();
             } else {
index 2f94072..dbc6ec9 100644 (file)
@@ -29,7 +29,7 @@ if ($eventID = Horde_Util::getFormData('eventID')) {
     }
     if ($driver != 'Resource') {
         $share = &$kronolith_shares->getShare($event->getCalendar());
-        if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE, $event->getCreatorID())) {
+        if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE, $event->getCreatorID())) {
             $notification->push(_("You do not have permission to delete this event."), 'horde.warning');
         } else {
             $have_perms = true;
index 0407fcd..22beca7 100644 (file)
@@ -32,7 +32,7 @@ v2.3.3-cvs
 [jan] Speed up listing alarms (patrick.abiven@apitech.fr, Request #8638).
 [jan] Simplify and improve portability of listing events without date limits
       in the SQL driver (Bug #8590).
-[mjr] Fix issue that caused the default alarm time to be applied to 
+[mjr] Fix issue that caused the default alarm time to be applied to
       listTimeObjects events (Bug #8588).
 
 
index 47ab29e..6e3fabd 100644 (file)
@@ -136,11 +136,11 @@ if ($exception = Horde_Util::getFormData('del_exception')) {
                 $sourceShare = Kronolith::getInternalCalendar($source);
                 if (!is_a($share, 'PEAR_Error') &&
                     !is_a($sourceShare, 'PEAR_Error') &&
-                    $sourceShare->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE) &&
+                    $sourceShare->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE) &&
                     (($user == Horde_Auth::getAuth() &&
-                      $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) ||
+                      $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) ||
                      ($user != Horde_Auth::getAuth() &&
-                      $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELEGATE)))) {
+                      $share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE)))) {
                     $kronolith_driver->open($source);
                     $res = $kronolith_driver->move(Horde_Util::getFormData('eventID'), $target);
                     if (is_a($res, 'PEAR_Error')) {
@@ -157,13 +157,13 @@ if ($exception = Horde_Util::getFormData('del_exception')) {
 
         if ($event && !is_a($event, 'PEAR_Error')) {
             if (isset($sourceShare) && !is_a($sourceShare, 'PEAR_Error')
-                && !$sourceShare->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+                && !$sourceShare->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
                 $notification->push(_("You do not have permission to move this event."), 'horde.warning');
             } elseif ($user != Horde_Auth::getAuth() &&
-                      !$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELEGATE, $event->getCreatorID())) {
+                      !$share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE, $event->getCreatorID())) {
                 $notification->push(sprintf(_("You do not have permission to delegate events to %s."), Kronolith::getUserName($user)), 'horde.warning');
             } elseif ($user == Horde_Auth::getAuth() &&
-                      !$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT, $event->getCreatorID())) {
+                      !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $event->getCreatorID())) {
                 $notification->push(_("You do not have permission to edit this event."), 'horde.warning');
             } else {
                 $event->readForm();
index f3ccd48..5dfcd05 100644 (file)
@@ -33,7 +33,7 @@ if (is_a($share, 'PEAR_Error')) {
                sprintf(_("The requested feed (%s) was not found on this server."),
                        htmlspecialchars($calendar)));
 }
-if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     if (Horde_Auth::getAuth()) {
         _no_access(403, 'Forbidden',
                    sprintf(_("Permission denied for the requested feed (%s)."),
index f529652..6f58a9f 100644 (file)
@@ -50,10 +50,10 @@ class Kronolith_Ajax_Imple_TagActions extends Horde_Ajax_Imple_Base
         // Check perms
         if ($post['type'] == 'calendar') {
             $cal = $GLOBALS['kronolith_shares']->getShare($post['resource']);
-            $perm = $cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+            $perm = $cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
         } elseif($post['type'] == 'event') {
             $event = Kronolith::getDriver()->getByUID($post['resource']);
-            $perm = $event->hasPermission(PERMS_EDIT, Horde_Auth::getAuth());
+            $perm = $event->hasPermission(Horde_Perms::EDIT, Horde_Auth::getAuth());
         }
 
         if ($perm) {
@@ -91,10 +91,10 @@ class Kronolith_Ajax_Imple_TagActions extends Horde_Ajax_Imple_Base
 
         if ($type == 'calendar') {
             $cal = $GLOBALS['kronolith_shares']->getShare($id);
-            $hasEdit = $cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+            $hasEdit = $cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
         } elseif ($type == 'event') {
             $event = Kronolith::getDriver()->getByUID($id);
-            $hasEdit = $event->hasPermission(PERMS_EDIT, Horde_Auth::getAuth());
+            $hasEdit = $event->hasPermission(Horde_Perms::EDIT, Horde_Auth::getAuth());
         }
 
         foreach ($tags as $tag_id => $tag) {
index 71a593a..4f74eca 100644 (file)
@@ -73,7 +73,7 @@ class Kronolith_Api extends Horde_Registry_Api
         if (empty($path)) {
             // This request is for a list of all users who have calendars
             // visible to the requesting user.
-            $calendars = Kronolith::listCalendars(false, PERMS_READ);
+            $calendars = Kronolith::listCalendars(false, Horde_Perms::READ);
             $owners = array();
             foreach ($calendars as $calendar) {
                 $owners[$calendar->get('owner')] = true;
@@ -125,7 +125,7 @@ class Kronolith_Api extends Horde_Registry_Api
         } elseif (count($parts) == 1) {
             // This request is for all calendars owned by the requested user
             $calendars = $GLOBALS['kronolith_shares']->listShares(Horde_Auth::getAuth(),
-                                                                  PERMS_SHOW,
+                                                                  Horde_Perms::SHOW,
                                                                   $parts[0]);
             $results = array();
             foreach ($calendars as $calendarId => $calendar) {
@@ -143,7 +143,7 @@ class Kronolith_Api extends Horde_Registry_Api
                     $results[$retpath . '.ics']['icon'] = $registry->getImageDir() . '/mime/icalendar.png';
                 }
                 if (in_array('browseable', $properties)) {
-                    $results[$retpath]['browseable'] = $calendar->hasPermission(Horde_Auth::getAuth(), PERMS_READ);
+                    $results[$retpath]['browseable'] = $calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ);
                     $results[$retpath . '.ics']['browseable'] = false;
                 }
                 if (in_array('contenttype', $properties)) {
@@ -172,7 +172,7 @@ class Kronolith_Api extends Horde_Registry_Api
             return $results;
 
         } elseif (count($parts) == 2 &&
-                  array_key_exists($parts[1], Kronolith::listCalendars(false, PERMS_READ))) {
+                  array_key_exists($parts[1], Kronolith::listCalendars(false, Horde_Perms::READ))) {
             // This request is browsing into a specific calendar.  Generate
             // the list of items and represent them as files within the
             // directory.
@@ -222,7 +222,7 @@ class Kronolith_Api extends Horde_Registry_Api
             // The only valid request left is for either a specific event or
             // for the entire calendar.
             if (count($parts) == 3 &&
-                array_key_exists($parts[1], Kronolith::listCalendars(false, PERMS_READ))) {
+                array_key_exists($parts[1], Kronolith::listCalendars(false, Horde_Perms::READ))) {
                 // This request is for a specific item within a given calendar.
                 $event = Kronolith::getDriver(null, $parts[1])->getEvent($parts[2]);
                 if (is_a($event, 'PEAR_Error')) {
@@ -239,7 +239,7 @@ class Kronolith_Api extends Horde_Registry_Api
                 return $result;
             } elseif (count($parts) == 2 &&
                       substr($parts[1], -4, 4) == '.ics' &&
-                      array_key_exists(substr($parts[1], 0, -4), Kronolith::listCalendars(false, PERMS_READ))) {
+                      array_key_exists(substr($parts[1], 0, -4), Kronolith::listCalendars(false, Horde_Perms::READ))) {
                 // This request is for an entire calendar (calendar.ics).
                 $ical_data = $this->exportCalendar(substr($parts[1], 0, -4), 'text/calendar');
                 $result = array('data'          => $ical_data,
@@ -293,7 +293,7 @@ class Kronolith_Api extends Horde_Registry_Api
             return PEAR::raiseError("Invalid calendar data supplied.");
         }
 
-        if (!array_key_exists($calendar, Kronolith::listCalendars(false, PERMS_EDIT))) {
+        if (!array_key_exists($calendar, Kronolith::listCalendars(false, Horde_Perms::EDIT))) {
             // FIXME: Should we attempt to create a calendar based on the
             // filename in the case that the requested calendar does not
             // exist?
@@ -378,7 +378,7 @@ class Kronolith_Api extends Horde_Registry_Api
             return PEAR::raiseError(sprintf(_("Unsupported Content-Type: %s"), $content_type));
         }
 
-        if (array_key_exists($calendar, Kronolith::listCalendars(false, PERMS_DELETE))) {
+        if (array_key_exists($calendar, Kronolith::listCalendars(false, Horde_Perms::DELETE))) {
             foreach (array_keys($uids_remove) as $uid) {
                 $this->delete($uid);
             }
@@ -412,7 +412,7 @@ class Kronolith_Api extends Horde_Registry_Api
         }
 
         if (!(count($parts) == 2 || count($parts) == 3) ||
-            !array_key_exists($calendarId, Kronolith::listCalendars(false, PERMS_DELETE))) {
+            !array_key_exists($calendarId, Kronolith::listCalendars(false, Horde_Perms::DELETE))) {
                 return PEAR::raiseError("Calendar does not exist or no permission to delete");
             }
 
@@ -450,7 +450,7 @@ class Kronolith_Api extends Horde_Registry_Api
         $no_maint = true;
         require_once dirname(__FILE__) . '/base.php';
         if (is_null($permission)) {
-            $permission = PERMS_SHOW;
+            $permission = Horde_Perms::SHOW;
         }
         return array_keys(Kronolith::listCalendars($owneronly, $permission));
     }
@@ -473,7 +473,7 @@ class Kronolith_Api extends Horde_Registry_Api
             $calendar = Kronolith::getDefaultCalendar();
         }
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_READ))) {
+            Kronolith::listCalendars(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -517,7 +517,7 @@ class Kronolith_Api extends Horde_Registry_Api
         }
 
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_READ))) {
+            Kronolith::listCalendars(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -550,7 +550,7 @@ class Kronolith_Api extends Horde_Registry_Api
         }
 
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_READ))) {
+            Kronolith::listCalendars(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -578,10 +578,10 @@ class Kronolith_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if (!isset($calendar)) {
-            $calendar = Kronolith::getDefaultCalendar(PERMS_EDIT);
+            $calendar = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
         }
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_EDIT))) {
+            Kronolith::listCalendars(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -625,7 +625,7 @@ class Kronolith_Api extends Horde_Registry_Api
                                 $match->end == $event->end &&
                                 $match->title == $event->title &&
                                 $match->location == $event->location &&
-                                $match->hasPermission(PERMS_EDIT)) {
+                                $match->hasPermission(Horde_Perms::EDIT)) {
                                     return PEAR::raiseError(_("Already Exists"), 'horde.message', null, null, $match->getUID());
                                 }
                         }
@@ -666,10 +666,10 @@ class Kronolith_Api extends Horde_Registry_Api
         global $kronolith_shares;
 
         if (!isset($calendar)) {
-            $calendar = Kronolith::getDefaultCalendar(PERMS_EDIT);
+            $calendar = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
         }
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_EDIT))) {
+            Kronolith::listCalendars(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -706,7 +706,7 @@ class Kronolith_Api extends Horde_Registry_Api
         if (is_a($event, 'PEAR_Error')) {
             return $event;
         }
-        if (!$event->hasPermission(PERMS_READ)) {
+        if (!$event->hasPermission(Horde_Perms::READ)) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -753,7 +753,7 @@ class Kronolith_Api extends Horde_Registry_Api
         global $kronolith_shares;
 
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_READ))) {
+            Kronolith::listCalendars(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -822,7 +822,7 @@ class Kronolith_Api extends Horde_Registry_Api
 
         // First try the user's own calendars.
         if (empty($event)) {
-            $ownerCalendars = Kronolith::listCalendars(true, PERMS_DELETE);
+            $ownerCalendars = Kronolith::listCalendars(true, Horde_Perms::DELETE);
             foreach ($events as $ev) {
                 if (Horde_Auth::isAdmin() || isset($ownerCalendars[$ev->getCalendar()])) {
                     $event = $ev;
@@ -833,7 +833,7 @@ class Kronolith_Api extends Horde_Registry_Api
 
         // If not successful, try all calendars the user has access to.
         if (empty($event)) {
-            $deletableCalendars = Kronolith::listCalendars(false, PERMS_DELETE);
+            $deletableCalendars = Kronolith::listCalendars(false, Horde_Perms::DELETE);
             foreach ($events as $ev) {
                 if (isset($deletableCalendars[$ev->getCalendar()])) {
                     $kronolith_driver->open($ev->getCalendar());
@@ -874,7 +874,7 @@ class Kronolith_Api extends Horde_Registry_Api
             return $event;
         }
 
-        if (!$event->hasPermission(PERMS_EDIT) ||
+        if (!$event->hasPermission(Horde_Perms::EDIT) ||
             ($event->isPrivate() && $event->getCreatorId() != Horde_Auth::getAuth())) {
             return PEAR::raiseError(_("Permission Denied"));
         }
@@ -965,7 +965,7 @@ class Kronolith_Api extends Horde_Registry_Api
         if (is_a($event, 'PEAR_Error')) {
             return $event;
         }
-        if (!$event->hasPermission(PERMS_SHOW)) {
+        if (!$event->hasPermission(Horde_Perms::SHOW)) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -1005,7 +1005,7 @@ class Kronolith_Api extends Horde_Registry_Api
         }
 
         /* First try the user's own calendars. */
-        $ownerCalendars = Kronolith::listCalendars(true, PERMS_EDIT);
+        $ownerCalendars = Kronolith::listCalendars(true, Horde_Perms::EDIT);
         $event = null;
         foreach ($events as $ev) {
             if (isset($ownerCalendars[$ev->getCalendar()])) {
@@ -1016,7 +1016,7 @@ class Kronolith_Api extends Horde_Registry_Api
 
         /* If not successful, try all calendars the user has access to. */
         if (empty($event)) {
-            $editableCalendars = Kronolith::listCalendars(false, PERMS_EDIT);
+            $editableCalendars = Kronolith::listCalendars(false, Horde_Perms::EDIT);
             foreach ($events as $ev) {
                 if (isset($editableCalendars[$ev->getCalendar()])) {
                     $event = $ev;
@@ -1091,7 +1091,7 @@ class Kronolith_Api extends Horde_Registry_Api
         } elseif (!is_array($calendars)) {
             $calendars = array($calendars);
         }
-        $allowed_calendars = Kronolith::listCalendars(false, PERMS_READ);
+        $allowed_calendars = Kronolith::listCalendars(false, Horde_Perms::READ);
         foreach ($calendars as $calendar) {
             if (!array_key_exists($calendar, $allowed_calendars)) {
                 return PEAR::raiseError(_("Permission Denied"));
@@ -1139,8 +1139,8 @@ class Kronolith_Api extends Horde_Registry_Api
                 continue;
             }
             if (empty($user)) {
-                $users = $share->listUsers(PERMS_READ);
-                $groups = $share->listGroups(PERMS_READ);
+                $users = $share->listUsers(Horde_Perms::READ);
+                $groups = $share->listGroups(Horde_Perms::READ);
                 foreach ($groups as $gid) {
                     $group_users = $group->listUsers($gid);
                     if (!is_a($group_users, 'PEAR_Error')) {
@@ -1287,7 +1287,7 @@ class Kronolith_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_EDIT))) {
+            Kronolith::listCalendars(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -1307,7 +1307,7 @@ class Kronolith_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_EDIT))) {
+            Kronolith::listCalendars(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -1327,7 +1327,7 @@ class Kronolith_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if (!array_key_exists($calendar,
-            Kronolith::listCalendars(false, PERMS_READ))) {
+            Kronolith::listCalendars(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
index 206808c..7239d22 100644 (file)
@@ -75,7 +75,7 @@ class Horde_Block_Kronolith_month extends Horde_Block {
             if (is_a($this->_share, 'PEAR_Error')) {
                 return $this->_share;
             }
-            if (!$this->_share->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
+            if (!$this->_share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
                 return _("Permission Denied");
             }
         }
index 32c3409..a7eda0b 100644 (file)
@@ -76,7 +76,7 @@ class Horde_Block_Kronolith_monthlist extends Horde_Block {
 
         if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
             $calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
-            if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
+            if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
                 return _("Permission Denied");
             }
             $all_events = Kronolith::listEvents($startDate, $endDate, array($this->_params['calendar']), true, false, false);
index 33d409a..d49638b 100644 (file)
@@ -72,7 +72,7 @@ class Horde_Block_Kronolith_prevmonthlist extends Horde_Block {
 
         if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
             $calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
-            if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
+            if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
                 return _("Permission Denied");
             }
             $all_events = Kronolith::listEvents($startDate, $endDate, array($this->_params['calendar']), true, false, false);
index ed9e7de..3f00567 100644 (file)
@@ -98,7 +98,7 @@ class Horde_Block_Kronolith_summary extends Horde_Block {
             $this->_params['calendar'] != '__all') {
 
             $calendar = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
-            if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), PERMS_SHOW)) {
+            if (!is_a($calendar, 'PEAR_Error') && !$calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
                 return _("Permission Denied");
             }
 
index d035bed..fedc9e8 100644 (file)
@@ -285,7 +285,7 @@ class Kronolith_Driver_Kolab extends Kronolith_Driver
     public function getByUID($uid, $calendars = null, $getAll = false)
     {
         if (!is_array($calendars)) {
-            $calendars = array_keys(Kronolith::listCalendars(true, PERMS_READ));
+            $calendars = array_keys(Kronolith::listCalendars(true, Horde_Perms::READ));
         }
 
         foreach ($calendars as $calendar) {
index 1588410..b9af6e6 100644 (file)
@@ -174,17 +174,17 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql
     /**
      * Return a list of Kronolith_Resources
      *
-     * Right now, all users have PERMS_READ, but only system admins have
-     * PERMS_EDIT | PERMS_DELETE
+     * Right now, all users have Horde_Perms::READ, but only system admins have
+     * Horde_Perms::EDIT | Horde_Perms::DELETE
      *
-     * @param int $perms     A PERMS_* constant.
+     * @param int $perms     A Horde_Perms::* constant.
      * @param array $filter  A hash of field/values to filter on.
      *
      * @return an array of Kronolith_Resource objects.
      */
-    public function listResources($perms = PERMS_READ, $filter = array())
+    public function listResources($perms = Horde_Perms::READ, $filter = array())
     {
-        if (($perms & (PERMS_EDIT | PERMS_DELETE)) && !Horde_Auth::isAdmin()) {
+        if (($perms & (Horde_Perms::EDIT | Horde_Perms::DELETE)) && !Horde_Auth::isAdmin()) {
             return array();
         }
 
@@ -223,7 +223,7 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql
      */
     public function getGroupMemberships($resource_id)
     {
-        $groups = $this->listResources(PERMS_READ, array('type' => Kronolith_Resource::TYPE_GROUP));
+        $groups = $this->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_GROUP));
         $in = array();
         foreach ($groups as $group) {
             $members = $group->get('members');
index 244a640..9ce1266 100644 (file)
@@ -510,7 +510,7 @@ class Kronolith_Driver_Sql extends Kronolith_Driver
         }
 
         /* First try the user's own calendars. */
-        $ownerCalendars = Kronolith::listCalendars(true, PERMS_READ);
+        $ownerCalendars = Kronolith::listCalendars(true, Horde_Perms::READ);
         $event = null;
         foreach ($eventArray as $ev) {
             if (isset($ownerCalendars[$ev->getCalendar()])) {
@@ -521,7 +521,7 @@ class Kronolith_Driver_Sql extends Kronolith_Driver
 
         /* If not successful, try all calendars the user has access too. */
         if (empty($event)) {
-            $readableCalendars = Kronolith::listCalendars(false, PERMS_READ);
+            $readableCalendars = Kronolith::listCalendars(false, Horde_Perms::READ);
             foreach ($eventArray as $ev) {
                 if (isset($readableCalendars[$ev->getCalendar()])) {
                     $event = $ev;
@@ -911,7 +911,7 @@ class Kronolith_Driver_Sql extends Kronolith_Driver
             return PEAR::raiseError(_("Permission Denied"));
         }
 
-        $shares = $GLOBALS['kronolith_shares']->listShares($user, PERMS_EDIT);
+        $shares = $GLOBALS['kronolith_shares']->listShares($user, Horde_Perms::EDIT);
         if (is_a($shares, 'PEAR_Error')) {
             return $shares;
         }
index e9c1206..60272e6 100644 (file)
@@ -305,9 +305,9 @@ abstract class Kronolith_Event
 
         if ($this->remoteCal) {
             switch ($permission) {
-            case PERMS_SHOW:
-            case PERMS_READ:
-            case PERMS_EDIT:
+            case Horde_Perms::SHOW:
+            case Horde_Perms::READ:
+            case Horde_Perms::EDIT:
                 return true;
 
             default:
@@ -1132,8 +1132,8 @@ abstract class Kronolith_Event
         $json->al = is_null($allDay) ? $this->isAllDay() : $allDay;
         $json->bg = $this->_backgroundColor;
         $json->fg = $this->_foregroundColor;
-        $json->pe = $this->hasPermission(PERMS_EDIT);
-        $json->pd = $this->hasPermission(PERMS_DELETE);
+        $json->pe = $this->hasPermission(Horde_Perms::EDIT);
+        $json->pd = $this->hasPermission(Horde_Perms::DELETE);
         if ($this->alarm) {
             if ($this->alarm % 10080 == 0) {
                 $alarm_value = $this->alarm / 10080;
@@ -1450,7 +1450,7 @@ abstract class Kronolith_Event
         if (!Horde_Auth::isAdmin() && $this->isPrivate() &&
             $this->getCreatorId() != $user) {
             return _("busy");
-        } elseif (Horde_Auth::isAdmin() || $this->hasPermission(PERMS_READ, $user)) {
+        } elseif (Horde_Auth::isAdmin() || $this->hasPermission(Horde_Perms::READ, $user)) {
             return strlen($this->title) ? $this->title : _("[Unnamed event]");
         } else {
             return _("busy");
@@ -2348,7 +2348,7 @@ abstract class Kronolith_Event
 
         $event_title = $this->getTitle();
         $view_url = $this->getViewUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full);
-        $read_permission = $this->hasPermission(PERMS_READ);
+        $read_permission = $this->hasPermission(Horde_Perms::READ);
 
         $link = '';
         if (isset($this->external) && !empty($this->external_link)) {
@@ -2416,13 +2416,13 @@ abstract class Kronolith_Event
             $edit = '';
             $delete = '';
             if ((!$this->isPrivate() || $this->getCreatorId() == Horde_Auth::getAuth())
-                && $this->hasPermission(PERMS_EDIT)) {
+                && $this->hasPermission(Horde_Perms::EDIT)) {
                 $editurl = Horde_Util::addParameter($view_url, 'view', 'EditEvent', !$full);
                 $edit = Horde::link($editurl, sprintf(_("Edit %s"), $event_title), 'iconEdit')
                     . Horde::fullSrcImg('edit-' . $icon_color . '.png', array('attr' => 'alt="' . _("Edit") . '"'))
                     . '</a>';
             }
-            if ($this->hasPermission(PERMS_DELETE)) {
+            if ($this->hasPermission(Horde_Perms::DELETE)) {
                 $delurl = Horde_Util::addParameter($view_url, 'view', 'DeleteEvent', !$full);
                 $delete = Horde::link($delurl, sprintf(_("Delete %s"), $event_title), 'iconDelete')
                     . Horde::fullSrcImg('delete-' . $icon_color . '.png', array('attr' => 'alt="' . _("Delete") . '"'))
index 621d275..174da2b 100644 (file)
@@ -35,7 +35,7 @@ class Kronolith_CreateResourceForm extends Horde_Form {
 
         /* Get a list of available resource groups */
         $driver = Kronolith::getDriver('Resource');
-        $groups = $driver->listResources(PERMS_READ, array('type' => Kronolith_Resource::TYPE_GROUP));
+        $groups = $driver->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_GROUP));
         foreach ($groups as $id => $group) {
             $enum[$id] = $group->get('name');
         }
index 90b28e7..6bc71d2 100644 (file)
@@ -28,7 +28,7 @@ class Kronolith_CreateResourceGroupForm extends Horde_Form {
     {
         parent::Horde_Form($vars, _("Create Resource"));
 
-        $resources = Kronolith::getDriver('Resource')->listResources(PERMS_READ, array('type' => Kronolith_Resource::TYPE_SINGLE));
+        $resources = Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_SINGLE));
         $enum = array();
         foreach ($resources as $resource) {
             $enum[$resource->getId()] = htmlspecialchars($resource->get('name'));
index 6754697..46f9d54 100644 (file)
@@ -46,7 +46,7 @@ class Kronolith_DeleteResourceForm extends Horde_Form {
             return false;
         }
 
-        if (!($this->_resource->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE))) {
+        if (!($this->_resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE))) {
             return PEAR::raiseError(_("Permission denied"));
         }
 
index d8455c1..01a8e1a 100644 (file)
@@ -46,7 +46,7 @@ class Kronolith_DeleteResourceGroupForm extends Horde_Form {
             return false;
         }
 
-        if (!($this->_resource->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE))) {
+        if (!($this->_resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE))) {
             return PEAR::raiseError(_("Permission denied"));
         }
 
index 3381d7b..cdbeb7c 100644 (file)
@@ -40,7 +40,7 @@ class Kronolith_EditResourceForm extends Horde_Form {
 
         /* Get a list of available resource groups */
         $driver = Kronolith::getDriver('Resource');
-        $groups = $driver->listResources(PERMS_READ, array('type' => Kronolith_Resource::TYPE_GROUP));
+        $groups = $driver->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_GROUP));
         $enum = array();
         foreach ($groups as $id => $group) {
             $enum[$id] = $group->get('name');
index 54597ce..fe7959d 100644 (file)
@@ -32,7 +32,7 @@ class Kronolith_EditResourceGroupForm extends Horde_Form {
     {
         $this->_resource = &$resource;
         parent::Horde_Form($vars, sprintf(_("Edit %s"), $resource->get('name')));
-        $resources = Kronolith::getDriver('Resource')->listResources(PERMS_READ, array('type' => Kronolith_Resource::TYPE_SINGLE));
+        $resources = Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_SINGLE));
         $enum = array();
         foreach ($resources as $r) {
             $enum[$r->getId()] = htmlspecialchars($r->get('name'));
index 2eb16d0..edd30fd 100644 (file)
@@ -8,9 +8,6 @@
  * @package Kronolith
  */
 
-/** The event can be delegated. */
-define('PERMS_DELEGATE', 1024);
-
 /**
  * The Kronolith:: class provides functionality common to all of Kronolith.
  *
@@ -45,6 +42,9 @@ class Kronolith
     /** Free/Busy not found */
     const ERROR_FB_NOT_FOUND = 1;
 
+    /** The event can be delegated. */
+    const PERMS_DELEGATE = 1024;
+
     /**
      * Driver singleton instances.
      *
@@ -129,7 +129,7 @@ class Kronolith
             'name' => $registry->get('name'),
             'is_ie6' => ($browser->isBrowser('msie') && ($browser->getMajor() < 7)),
             'login_view' => $prefs->getValue('defaultview'),
-            'default_calendar' => 'internal|' . self::getDefaultCalendar(PERMS_EDIT),
+            'default_calendar' => 'internal|' . self::getDefaultCalendar(Horde_Perms::EDIT),
             'week_start' => (int)$prefs->getValue('week_start_monday'),
             'date_format' => str_replace(array('%e', '%d', '%a', '%A', '%m', '%h', '%b', '%B', '%y', '%Y'),
                                          array('d', 'dd', 'ddd', 'dddd', 'MM', 'MMM', 'MMM', 'MMMM', 'yy', 'yyyy'),
@@ -169,7 +169,7 @@ class Kronolith
                         'fg' => self::foregroundColor($calendar),
                         'bg' => self::backgroundColor($calendar),
                         'show' => in_array($id, $GLOBALS['display_calendars']),
-                        'edit' => $calendar->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT));
+                        'edit' => $calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT));
                 }
             }
 
@@ -177,7 +177,7 @@ class Kronolith
             if (!$has_tasks) {
                 continue;
             }
-            foreach ($GLOBALS['registry']->tasks->listTasklists($my, PERMS_SHOW) as $id => $tasklist) {
+            foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW) as $id => $tasklist) {
                 $owner = $tasklist->get('owner') == Horde_Auth::getAuth();
                 if (($my && $owner) || (!$my && !$owner)) {
                     $code['conf']['calendars']['tasklists']['tasks/' . $id] = array(
@@ -187,7 +187,7 @@ class Kronolith
                         'fg' => self::foregroundColor($tasklist),
                         'bg' => self::backgroundColor($tasklist),
                         'show' => in_array('tasks/' . $id, $GLOBALS['display_external_calendars']),
-                        'edit' => $tasklist->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT));
+                        'edit' => $tasklist->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT));
                 }
             }
         }
@@ -674,7 +674,7 @@ class Kronolith
         }
 
         $kronolith_driver = self::getDriver();
-        $calendars = self::listCalendars(true, PERMS_ALL);
+        $calendars = self::listCalendars(true, Horde_Perms::ALL);
         $current_calendar = $kronolith_driver->getCalendar();
 
         $count = 0;
@@ -978,13 +978,13 @@ class Kronolith
                 $perm_value = 0;
                 switch ($GLOBALS['conf']['autoshare']['shareperms']) {
                 case 'read':
-                    $perm_value = PERMS_READ | PERMS_SHOW;
+                    $perm_value = Horde_Perms::READ | Horde_Perms::SHOW;
                     break;
                 case 'edit':
-                    $perm_value = PERMS_READ | PERMS_SHOW | PERMS_EDIT;
+                    $perm_value = Horde_Perms::READ | Horde_Perms::SHOW | Horde_Perms::EDIT;
                     break;
                 case 'full':
-                    $perm_value = PERMS_READ | PERMS_SHOW | PERMS_EDIT | PERMS_DELETE;
+                    $perm_value = Horde_Perms::READ | Horde_Perms::SHOW | Horde_Perms::EDIT | Horde_Perms::DELETE;
                     break;
                 }
                 $groups = &Group::singleton();
@@ -992,7 +992,7 @@ class Kronolith
                 if (!is_a($group_list, 'PEAR_Error') && count($group_list)) {
                     $perm = $share->getPermission();
                     // Add the default perm, not added otherwise
-                    $perm->addUserPermission(Horde_Auth::getAuth(), PERMS_ALL, false);
+                    $perm->addUserPermission(Horde_Auth::getAuth(), Horde_Perms::ALL, false);
                     foreach ($group_list as $group_id => $group_name) {
                         $perm->addGroupPermission($group_id, $perm_value, false);
                     }
@@ -1254,7 +1254,7 @@ class Kronolith
      *
      * @return array  The calendar list.
      */
-    public static function listCalendars($owneronly = false, $permission = PERMS_SHOW)
+    public static function listCalendars($owneronly = false, $permission = Horde_Perms::SHOW)
     {
         $calendars = $GLOBALS['kronolith_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
         if (is_a($calendars, 'PEAR_Error')) {
@@ -1269,7 +1269,7 @@ class Kronolith
      * Returns the default calendar for the current user at the specified
      * permissions level.
      */
-    public static function getDefaultCalendar($permission = PERMS_SHOW)
+    public static function getDefaultCalendar($permission = Horde_Perms::SHOW)
     {
         global $prefs;
 
@@ -1539,13 +1539,13 @@ class Kronolith
         $owner = $share->get('owner');
         $recipients[$owner] = self::_notificationPref($owner, 'owner');
 
-        foreach ($share->listUsers(PERMS_READ) as $user) {
+        foreach ($share->listUsers(Horde_Perms::READ) as $user) {
             if (!isset($recipients[$user])) {
                 $recipients[$user] = self::_notificationPref($user, 'read', $calendar);
             }
         }
 
-        foreach ($share->listGroups(PERMS_READ) as $group) {
+        foreach ($share->listGroups(Horde_Perms::READ) as $group) {
             $group = $groups->getGroupById($group);
             if (is_a($group, 'PEAR_Error')) {
                 continue;
@@ -1812,7 +1812,7 @@ class Kronolith
                   'onclick' => 'return ShowTab(\'Event\');'));
         if ((!$event->isPrivate() ||
              $event->getCreatorId() == Horde_Auth::getAuth()) &&
-            $event->hasPermission(PERMS_EDIT)) {
+            $event->hasPermission(Horde_Perms::EDIT)) {
             $tabs->addTab(
                 $event->isRemote() ? _("Save As New") : _("_Edit"),
                 $event->getEditUrl(),
@@ -1820,7 +1820,7 @@ class Kronolith
                       'id' => 'tabEditEvent',
                       'onclick' => 'return ShowTab(\'EditEvent\');'));
         }
-        if ($event->hasPermission(PERMS_DELETE)) {
+        if ($event->hasPermission(Horde_Perms::DELETE)) {
             $tabs->addTab(
                 _("De_lete"),
                 $event->getDeleteUrl(array('confirm' => 1)),
@@ -1958,7 +1958,7 @@ class Kronolith
                     ->getEvent(Horde_Util::getFormData('eventID'));
             }
             if (!is_a($event, 'PEAR_Error') &&
-                !$event->hasPermission(PERMS_READ)) {
+                !$event->hasPermission(Horde_Perms::READ)) {
                 $event = PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -1975,7 +1975,7 @@ class Kronolith
                     ->getEvent(Horde_Util::getFormData('eventID'));
             }
             if (!is_a($event, 'PEAR_Error') &&
-                !$event->hasPermission(PERMS_EDIT)) {
+                !$event->hasPermission(Horde_Perms::EDIT)) {
                 $event = PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -1989,7 +1989,7 @@ class Kronolith
                     ->getEvent(Horde_Util::getFormData('eventID'));
             }
             if (!is_a($event, 'PEAR_Error') &&
-                !$event->hasPermission(PERMS_DELETE)) {
+                !$event->hasPermission(Horde_Perms::DELETE)) {
                 $event = PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -2006,7 +2006,7 @@ class Kronolith
                     ->getEvent(Horde_Util::getFormData('eventID'));
             }
             if (!is_a($event, 'PEAR_Error') &&
-                !$event->hasPermission(PERMS_READ)) {
+                !$event->hasPermission(Horde_Perms::READ)) {
                 $event = PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -2096,7 +2096,7 @@ class Kronolith
         $menu = new Horde_Menu();
 
         $menu->add(Horde::applicationUrl($prefs->getValue('defaultview') . '.php'), _("_Today"), 'today.png', null, null, null, '__noselection');
-        if (self::getDefaultCalendar(PERMS_EDIT) &&
+        if (self::getDefaultCalendar(Horde_Perms::EDIT) &&
             (!empty($conf['hooks']['permsdenied']) ||
              self::hasPermission('max_events') === true ||
              self::hasPermission('max_events') > self::countEvents())) {
index 2322ba5..e480794 100644 (file)
@@ -39,8 +39,8 @@ class Kronolith_LoginTasks_Task_PurgeEvents extends Horde_LoginTasks_Task
         $del_time = new Horde_Date($_SERVER['REQUEST_TIME']);
         $del_time->mday -= $GLOBALS['prefs']->getValue('purge_events_keep');
 
-        /* Need to have PERMS_DELETE on a calendar to delete events from it */
-        $calendars = Kronolith::listCalendars(false, PERMS_DELETE);
+        /* Need to have Horde_Perms::DELETE on a calendar to delete events from it */
+        $calendars = Kronolith::listCalendars(false, Horde_Perms::DELETE);
 
         /* Start building an event object to use for the search */
         $kronolith_driver = Kronolith::getDriver();
index d6fa357..9d15abb 100644 (file)
@@ -79,7 +79,7 @@ abstract class Kronolith_Resource_Base
      * @param $restrict
      * @return unknown_type
      */
-    public function hasPermission($user, $permission = PERMS_READ, $restrict = null)
+    public function hasPermission($user, $permission = Horde_Perms::READ, $restrict = null)
     {
         if (Horde_Auth::isAdmin()) {
             return true;
index 92791fe..08bf97d 100644 (file)
@@ -76,7 +76,7 @@ class Kronolith_View_Day extends Kronolith_Day {
 
         $started = false;
         $first_row = true;
-        $addLinks = Kronolith::getDefaultCalendar(PERMS_EDIT) &&
+        $addLinks = Kronolith::getDefaultCalendar(Horde_Perms::EDIT) &&
             (!empty($GLOBALS['conf']['hooks']['permsdenied']) ||
              Kronolith::hasPermission('max_events') === true ||
              Kronolith::hasPermission('max_events') > Kronolith::countEvents());
index 9624707..086dfe5 100644 (file)
@@ -60,11 +60,11 @@ class Kronolith_View_DeleteEvent {
         echo '</div>';
 
         if ($active && $GLOBALS['browser']->hasFeature('dom')) {
-            if ($this->event->hasPermission(PERMS_READ)) {
+            if ($this->event->hasPermission(Horde_Perms::READ)) {
                 $view = new Kronolith_View_Event($this->event);
                 $view->html(false);
             }
-            if ($this->event->hasPermission(PERMS_EDIT)) {
+            if ($this->event->hasPermission(Horde_Perms::EDIT)) {
                 $edit = new Kronolith_View_EditEvent($this->event);
                 $edit->html(false);
             }
index 286bfce..6d2348d 100644 (file)
@@ -42,11 +42,11 @@ class Kronolith_View_EditEvent {
         }
 
         if ($this->event->isRemote()) {
-            $calendar_id = Kronolith::getDefaultCalendar(PERMS_EDIT);
+            $calendar_id = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
         } else {
             $calendar_id = $this->event->getCalendar();
         }
-        if (!$this->event->hasPermission(PERMS_EDIT) &&
+        if (!$this->event->hasPermission(Horde_Perms::EDIT) &&
             !is_a($share = &$this->event->getShare(), 'PEAR_Error')) {
             $calendar_id .= ':' . $share->get('owner');
         }
@@ -62,15 +62,15 @@ class Kronolith_View_EditEvent {
         }
 
         $url = Horde_Util::getFormData('url');
-        $perms = PERMS_EDIT;
+        $perms = Horde_Perms::EDIT;
         if ($this->event->getCreatorId() == Horde_Auth::getAuth()) {
-            $perms |= PERMS_DELEGATE;
+            $perms |= Kronolith::PERMS_DELEGATE;
         }
         $calendars = Kronolith::listCalendars(false, $perms);
 
         $buttons = array();
         if (($this->event->isRemote() ||
-             !$this->event->hasPermission(PERMS_EDIT)) &&
+             !$this->event->hasPermission(Horde_Perms::EDIT)) &&
             (!empty($GLOBALS['conf']['hooks']['permsdenied']) ||
              Kronolith::hasPermission('max_events') === true ||
              Kronolith::hasPermission('max_events') > Kronolith::countEvents())) {
@@ -111,11 +111,11 @@ class Kronolith_View_EditEvent {
         echo '</div>';
 
         if ($active && $GLOBALS['browser']->hasFeature('dom')) {
-            if ($this->event->hasPermission(PERMS_READ)) {
+            if ($this->event->hasPermission(Horde_Perms::READ)) {
                 $view = new Kronolith_View_Event($this->event);
                 $view->html(false);
             }
-            if ($this->event->hasPermission(PERMS_DELETE)) {
+            if ($this->event->hasPermission(Horde_Perms::DELETE)) {
                 $delete = new Kronolith_View_DeleteEvent($this->event);
                 $delete->html(false);
             }
index b53911f..35a434e 100644 (file)
@@ -101,11 +101,11 @@ class Kronolith_View_Event {
         echo '</div>';
 
         if ($active && $GLOBALS['browser']->hasFeature('dom')) {
-            if ($this->event->hasPermission(PERMS_EDIT)) {
+            if ($this->event->hasPermission(Horde_Perms::EDIT)) {
                 $edit = new Kronolith_View_EditEvent($this->event);
                 $edit->html(false);
             }
-            if ($this->event->hasPermission(PERMS_DELETE)) {
+            if ($this->event->hasPermission(Horde_Perms::DELETE)) {
                 $delete = new Kronolith_View_DeleteEvent($this->event);
                 $delete->html(false);
             }
index 909748e..21cb1ff 100644 (file)
@@ -117,7 +117,7 @@ class Kronolith_View_Month {
 
         $sidebyside = $prefs->getValue('show_shared_side_by_side');
         $twentyFour = $prefs->getValue('twentyFour');
-        $addLinks = Kronolith::getDefaultCalendar(PERMS_EDIT) &&
+        $addLinks = Kronolith::getDefaultCalendar(Horde_Perms::EDIT) &&
             (!empty($GLOBALS['conf']['hooks']['permsdenied']) ||
              Kronolith::hasPermission('max_events') === true ||
              Kronolith::hasPermission('max_events') > Kronolith::countEvents());
index c0de01a..0465d1f 100644 (file)
@@ -25,7 +25,7 @@ if (Kronolith::hasPermission('max_events') !== true &&
     exit;
 }
 
-$calendar_id = Horde_Util::getFormData('calendar', Kronolith::getDefaultCalendar(PERMS_EDIT));
+$calendar_id = Horde_Util::getFormData('calendar', Kronolith::getDefaultCalendar(Horde_Perms::EDIT));
 if (!$calendar_id) {
     $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Horde_Util::getFormData('month'),
                                                                               'year' => Horde_Util::getFormData('year')));
@@ -65,7 +65,7 @@ if (isset($url)) {
 }
 
 $title = _("Add a new event");
-$calendars = Kronolith::listCalendars(false, PERMS_EDIT | PERMS_DELEGATE);
+$calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT | Kronolith::PERMS_DELEGATE);
 Horde::addScriptFile('popup.js', 'horde');
 require KRONOLITH_TEMPLATES . '/common-header.inc';
 require KRONOLITH_TEMPLATES . '/menu.inc';
index acf8af3..067ed11 100644 (file)
@@ -63,83 +63,83 @@ case 'editform':
 
         // Process default permissions.
         if (Horde_Util::getFormData('default_show')) {
-            $perm->addDefaultPermission(PERMS_SHOW, false);
+            $perm->addDefaultPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_SHOW, false);
+            $perm->removeDefaultPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('default_read')) {
-            $perm->addDefaultPermission(PERMS_READ, false);
+            $perm->addDefaultPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_READ, false);
+            $perm->removeDefaultPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('default_edit')) {
-            $perm->addDefaultPermission(PERMS_EDIT, false);
+            $perm->addDefaultPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_EDIT, false);
+            $perm->removeDefaultPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('default_delete')) {
-            $perm->addDefaultPermission(PERMS_DELETE, false);
+            $perm->addDefaultPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_DELETE, false);
+            $perm->removeDefaultPermission(Horde_Perms::DELETE, false);
         }
         if (Horde_Util::getFormData('default_delegate')) {
-            $perm->addDefaultPermission(PERMS_DELEGATE, false);
+            $perm->addDefaultPermission(Kronolith::PERMS_DELEGATE, false);
         } else {
-            $perm->removeDefaultPermission(PERMS_DELEGATE, false);
+            $perm->removeDefaultPermission(Kronolith::PERMS_DELEGATE, false);
         }
 
         // Process guest permissions.
         if (Horde_Util::getFormData('guest_show')) {
-            $perm->addGuestPermission(PERMS_SHOW, false);
+            $perm->addGuestPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeGuestPermission(PERMS_SHOW, false);
+            $perm->removeGuestPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('guest_read')) {
-            $perm->addGuestPermission(PERMS_READ, false);
+            $perm->addGuestPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeGuestPermission(PERMS_READ, false);
+            $perm->removeGuestPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('guest_edit')) {
-            $perm->addGuestPermission(PERMS_EDIT, false);
+            $perm->addGuestPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeGuestPermission(PERMS_EDIT, false);
+            $perm->removeGuestPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('guest_delete')) {
-            $perm->addGuestPermission(PERMS_DELETE, false);
+            $perm->addGuestPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeGuestPermission(PERMS_DELETE, false);
+            $perm->removeGuestPermission(Horde_Perms::DELETE, false);
         }
         if (Horde_Util::getFormData('guest_delegate')) {
-            $perm->addGuestPermission(PERMS_DELEGATE, false);
+            $perm->addGuestPermission(Kronolith::PERMS_DELEGATE, false);
         } else {
-            $perm->removeGuestPermission(PERMS_DELEGATE, false);
+            $perm->removeGuestPermission(Kronolith::PERMS_DELEGATE, false);
         }
 
         // Process creator permissions.
         if (Horde_Util::getFormData('creator_show')) {
-            $perm->addCreatorPermission(PERMS_SHOW, false);
+            $perm->addCreatorPermission(Horde_Perms::SHOW, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_SHOW, false);
+            $perm->removeCreatorPermission(Horde_Perms::SHOW, false);
         }
         if (Horde_Util::getFormData('creator_read')) {
-            $perm->addCreatorPermission(PERMS_READ, false);
+            $perm->addCreatorPermission(Horde_Perms::READ, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_READ, false);
+            $perm->removeCreatorPermission(Horde_Perms::READ, false);
         }
         if (Horde_Util::getFormData('creator_edit')) {
-            $perm->addCreatorPermission(PERMS_EDIT, false);
+            $perm->addCreatorPermission(Horde_Perms::EDIT, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_EDIT, false);
+            $perm->removeCreatorPermission(Horde_Perms::EDIT, false);
         }
         if (Horde_Util::getFormData('creator_delete')) {
-            $perm->addCreatorPermission(PERMS_DELETE, false);
+            $perm->addCreatorPermission(Horde_Perms::DELETE, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_DELETE, false);
+            $perm->removeCreatorPermission(Horde_Perms::DELETE, false);
         }
         if (Horde_Util::getFormData('creator_delegate')) {
-            $perm->addCreatorPermission(PERMS_DELEGATE, false);
+            $perm->addCreatorPermission(Kronolith::PERMS_DELEGATE, false);
         } else {
-            $perm->removeCreatorPermission(PERMS_DELEGATE, false);
+            $perm->removeCreatorPermission(Kronolith::PERMS_DELEGATE, false);
         }
 
         // Process user permissions.
@@ -164,29 +164,29 @@ case 'editform':
             }
 
             if (!empty($u_show[$key])) {
-                $perm->addUserPermission($user, PERMS_SHOW, false);
+                $perm->addUserPermission($user, Horde_Perms::SHOW, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_SHOW, false);
+                $perm->removeUserPermission($user, Horde_Perms::SHOW, false);
             }
             if (!empty($u_read[$key])) {
-                $perm->addUserPermission($user, PERMS_READ, false);
+                $perm->addUserPermission($user, Horde_Perms::READ, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_READ, false);
+                $perm->removeUserPermission($user, Horde_Perms::READ, false);
             }
             if (!empty($u_edit[$key])) {
-                $perm->addUserPermission($user, PERMS_EDIT, false);
+                $perm->addUserPermission($user, Horde_Perms::EDIT, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_EDIT, false);
+                $perm->removeUserPermission($user, Horde_Perms::EDIT, false);
             }
             if (!empty($u_delete[$key])) {
-                $perm->addUserPermission($user, PERMS_DELETE, false);
+                $perm->addUserPermission($user, Horde_Perms::DELETE, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_DELETE, false);
+                $perm->removeUserPermission($user, Horde_Perms::DELETE, false);
             }
             if (!empty($u_delegate[$key])) {
-                $perm->addUserPermission($user, PERMS_DELEGATE, false);
+                $perm->addUserPermission($user, Kronolith::PERMS_DELEGATE, false);
             } else {
-                $perm->removeUserPermission($user, PERMS_DELEGATE, false);
+                $perm->removeUserPermission($user, Kronolith::PERMS_DELEGATE, false);
             }
         }
 
@@ -204,29 +204,29 @@ case 'editform':
             }
 
             if (!empty($g_show[$key])) {
-                $perm->addGroupPermission($group, PERMS_SHOW, false);
+                $perm->addGroupPermission($group, Horde_Perms::SHOW, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_SHOW, false);
+                $perm->removeGroupPermission($group, Horde_Perms::SHOW, false);
             }
             if (!empty($g_read[$key])) {
-                $perm->addGroupPermission($group, PERMS_READ, false);
+                $perm->addGroupPermission($group, Horde_Perms::READ, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_READ, false);
+                $perm->removeGroupPermission($group, Horde_Perms::READ, false);
             }
             if (!empty($g_edit[$key])) {
-                $perm->addGroupPermission($group, PERMS_EDIT, false);
+                $perm->addGroupPermission($group, Horde_Perms::EDIT, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_EDIT, false);
+                $perm->removeGroupPermission($group, Horde_Perms::EDIT, false);
             }
             if (!empty($g_delete[$key])) {
-                $perm->addGroupPermission($group, PERMS_DELETE, false);
+                $perm->addGroupPermission($group, Horde_Perms::DELETE, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_DELETE, false);
+                $perm->removeGroupPermission($group, Horde_Perms::DELETE, false);
             }
             if (!empty($g_delegate[$key])) {
-                $perm->addGroupPermission($group, PERMS_DELEGATE, false);
+                $perm->addGroupPermission($group, Kronolith::PERMS_DELEGATE, false);
             } else {
-                $perm->removeGroupPermission($group, PERMS_DELEGATE, false);
+                $perm->removeGroupPermission($group, Kronolith::PERMS_DELEGATE, false);
             }
         }
 
index e0500c3..0a010c2 100644 (file)
@@ -25,7 +25,7 @@ if ($resource instanceof PEAR_Error) {
     $notification->push($resoruce, 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/', true));
     exit;
-} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
     $notification->push(_("You are not allowed to delete this resource."), 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/', true));
     exit;
index 8cb515a..7afbf39 100644 (file)
@@ -25,7 +25,7 @@ if ($resource instanceof PEAR_Error) {
     $notification->push($resource, 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/', true));
     exit;
-} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $notification->push(_("You are not allowed to change this resource."), 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/', true));
     exit;
index f0e2b58..ff906c4 100644 (file)
@@ -25,7 +25,7 @@ if ($resource instanceof PEAR_Error) {
     $notification->push($resoruce, 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/groups/', true));
     exit;
-} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+} elseif (!$resource->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
     $notification->push(_("You are not allowed to delete this resource group."), 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/groups/', true));
     exit;
index 4f77ff2..f22f478 100644 (file)
@@ -25,7 +25,7 @@ if ($group instanceof PEAR_Error) {
     $notification->push($group, 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/groups/', true));
     exit;
-} elseif (!$group->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+} elseif (!$group->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $notification->push(_("You are not allowed to change this resource."), 'horde.error');
     header('Location: ' . Horde::applicationUrl('resources/groups/', true));
     exit;
index d444fc9..c745e76 100644 (file)
@@ -18,7 +18,7 @@ if (!Horde_Auth::getAuth()) {
 $edit_url_base = Horde::applicationUrl('resources/groups/edit.php');
 $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('horde'));
 
-$resources = Kronolith::getDriver('Resource')->listResources(PERMS_EDIT, array('type' => Kronolith_Resource::TYPE_GROUP));
+$resources = Kronolith::getDriver('Resource')->listResources(Horde_Perms::EDIT, array('type' => Kronolith_Resource::TYPE_GROUP));
 //$display_url_base = Horde::applicationUrl('month.php', true, -1);
 $delete_url_base = Horde::applicationUrl('resources/groups/delete.php');
 $delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde'));
index a36ff72..9eb4ecd 100644 (file)
@@ -17,7 +17,7 @@ if (!Horde_Auth::getAuth()) {
 }
 $edit_url_base = Horde::applicationUrl('resources/edit.php');
 $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('horde'));
-$resources = Kronolith::getDriver('Resource')->listResources(PERMS_READ, array('type' => Kronolith_Resource::TYPE_SINGLE));
+$resources = Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_SINGLE));
 $display_url_base = Horde::applicationUrl('month.php', true, -1);
 $delete_url_base = Horde::applicationUrl('resources/delete.php');
 $delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde'));
index 8f3a669..0f6617e 100755 (executable)
@@ -56,7 +56,7 @@ function send_agendas()
         if (is_a($calendar, 'PEAR_Error')) {
             continue;
         }
-        $users = array_merge($users, $calendar->listUsers(PERMS_READ));
+        $users = array_merge($users, $calendar->listUsers(Horde_Perms::READ));
     }
 
     // Remove duplicates.
@@ -97,18 +97,18 @@ function send_agendas()
         // If we found an email address, generate the agenda.
         switch ($agenda_calendars) {
         case 'owner':
-            $calendars = $GLOBALS['shares']->listShares($user, PERMS_SHOW, $user);
+            $calendars = $GLOBALS['shares']->listShares($user, Horde_Perms::SHOW, $user);
             break;
 
         case 'read':
-            $calendars = $GLOBALS['shares']->listShares($user, PERMS_SHOW, null);
+            $calendars = $GLOBALS['shares']->listShares($user, Horde_Perms::SHOW, null);
             break;
 
         case 'show':
         default:
             $calendars = array();
             $shown_calendars = unserialize($prefs->getValue('display_cals'));
-            $cals = $GLOBALS['shares']->listShares($user, PERMS_SHOW, null);
+            $cals = $GLOBALS['shares']->listShares($user, Horde_Perms::SHOW, null);
             foreach ($cals as $calId => $cal) {
                 if (in_array($calId, $shown_calendars)) {
                     $calendars[$calId] = $cal;
index 256b041..3a0d2fd 100755 (executable)
@@ -76,7 +76,7 @@ while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) {
         $cli->fatal($result->toString());
     }
     while ($perm_row = $result->fetchRow()) {
-        $permissions[$perm_row[0]] = PERMS_READ | PERMS_SHOW;
+        $permissions[$perm_row[0]] = Horde_Perms::READ | Horde_Perms::SHOW;
     }
     $result = $db->execute($write_stmt, array($row['id']));
     if (is_a($result, 'PEAR_Error')) {
@@ -84,14 +84,14 @@ while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) {
     }
     while ($perm_row = $result->fetchRow()) {
         if (isset($permissions[$perm_row[0]])) {
-            $permissions[$perm_row[0]] |= PERMS_EDIT;
+            $permissions[$perm_row[0]] |= Horde_Perms::EDIT;
         } else {
-            $permissions[$perm_row[0]] = PERMS_EDIT;
+            $permissions[$perm_row[0]] = Horde_Perms::EDIT;
         }
     }
     if (count($permissions)) {
         $perm = $share->getPermission();
-        $perm->addUserPermission($user, PERMS_ALL, false);
+        $perm->addUserPermission($user, Horde_Perms::ALL, false);
         foreach ($permissions as $key => $value) {
             $perm->addUserPermission($key, $value, false);
         }
index a094d89..d5ce412 100644 (file)
@@ -66,7 +66,7 @@ if ($search_mode == 'basic') {
     $optgroup = $GLOBALS['browser']->hasFeature('optgroup');
     $current_user = Horde_Auth::getAuth();
     $calendars = array();
-    foreach (Kronolith::listCalendars(false, PERMS_READ) as $id => $cal) {
+    foreach (Kronolith::listCalendars(false, Horde_Perms::READ) as $id => $cal) {
         if ($cal->get('owner') == $current_user) {
             $calendars[_("My Calendars:")]['|' . $id] = $cal->get('name');
         } else {
index 1097ae1..279ed57 100644 (file)
@@ -15,7 +15,7 @@
       <option value="<?php echo Horde_Data::EXPORT_ICALENDAR ?>">iCalendar</option>
     </select><br /><br />
 
-    <?php if (count($calendars = Kronolith::listCalendars(false, PERMS_READ)) > 1): ?>
+    <?php if (count($calendars = Kronolith::listCalendars(false, Horde_Perms::READ)) > 1): ?>
     <?php echo Horde::label('exportCal', _("Select the calendar(s) to export from")) ?><br />
     <select id="exportCal" name="exportCal[]" multiple="multiple">
       <?php foreach ($calendars as $id => $cal) {
@@ -23,7 +23,7 @@
       } ?>
     </select><br /><br />
     <?php else: ?>
-    <input type="hidden" name="exportCal[]" value="<?php echo htmlspecialchars(Kronolith::getDefaultCalendar(PERMS_READ)) ?>" />
+    <input type="hidden" name="exportCal[]" value="<?php echo htmlspecialchars(Kronolith::getDefaultCalendar(Horde_Perms::READ)) ?>" />
     <?php endif; ?>
 
     <?php echo _("Limit the time span to export:") ?><br />
index 595ff1a..141c7a3 100644 (file)
@@ -14,7 +14,7 @@
       <option value="icalendar"><?php echo _("vCalendar/iCalendar") ?></option>
     </select><br />
 
-    <?php if (!$prefs->isLocked('default_share') && count($calendars = Kronolith::listCalendars(false, PERMS_EDIT)) > 1): ?>
+    <?php if (!$prefs->isLocked('default_share') && count($calendars = Kronolith::listCalendars(false, Horde_Perms::EDIT)) > 1): ?>
     <?php echo Horde::label('importCal', _("Select the calendar to import to:")) ?><br />
     <select id="importCal" name="importCal">
       <?php foreach ($calendars as $id => $cal) {
@@ -22,7 +22,7 @@
       } ?>
     </select><br /><br />
     <?php else: ?>
-    <input type="hidden" name="importCal" value="<?php echo htmlspecialchars(Kronolith::getDefaultCalendar(PERMS_EDIT)) ?>" />
+    <input type="hidden" name="importCal" value="<?php echo htmlspecialchars(Kronolith::getDefaultCalendar(Horde_Perms::EDIT)) ?>" />
     <?php endif; ?>
     <?php echo Horde::label('import_file', _("Select the file to import:")) ?><br />
     <input type="file" id="import_file" name="import_file" size="40" />
index dae23bd..b8d749e 100644 (file)
@@ -81,7 +81,7 @@
         // Normal view
         foreach ($calendars as $id => $cal) {
             $delegates = array();
-            if ($cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT, $creator)) {
+            if ($cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $creator)) {
                 $delegates[$id] = htmlspecialchars($cal->get('name'));
             } else {
                 $delegates[$id . ':' . $cal->get('owner')] = htmlspecialchars($cal->get('name'). ' (' . sprintf(_("as %s"), Kronolith::getUserName($cal->get('owner'))) . ')');
index 5cac690..6d9b9bb 100644 (file)
@@ -68,7 +68,7 @@ $tagger = Kronolith::getTagger();
          <li class="panel-tags">
 <?php
 echo $tag;
-if ($cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if ($cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     echo '<a href="#" id="remove' . md5($id . $tag_id) . '">'
         . Horde::img('delete-small.png', _("Remove Tag"), '', $registry->getImageDir('horde'))
         . '</a>';
index ac6e9ad..4865ccb 100644 (file)
 <tr>
   <td class="light">&nbsp;</td>
   <td align="center">
-    <input type="checkbox" id="default_show" name="default_show"<?php echo ($dperm & PERMS_SHOW) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="default_show" name="default_show"<?php echo ($dperm & Horde_Perms::SHOW) ? ' checked="checked"' : '' ?> />
     <label for="default_show" class="hidden"><?php echo _("Show") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="default_read" name="default_read"<?php echo ($dperm & PERMS_READ) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="default_read" name="default_read"<?php echo ($dperm & Horde_Perms::READ) ? ' checked="checked"' : '' ?> />
     <label for="default_read" class="hidden"><?php echo _("Read") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="default_edit" name="default_edit"<?php echo ($dperm & PERMS_EDIT) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="default_edit" name="default_edit"<?php echo ($dperm & Horde_Perms::EDIT) ? ' checked="checked"' : '' ?> />
     <label for="default_edit" class="hidden"><?php echo _("Edit") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="default_delete" name="default_delete"<?php echo ($dperm & PERMS_DELETE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="default_delete" name="default_delete"<?php echo ($dperm & Horde_Perms::DELETE) ? ' checked="checked"' : '' ?> />
     <label for="default_delete" class="hidden"><?php echo _("Delete") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="default_delegate" name="default_delegate"<?php echo ($dperm & PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="default_delegate" name="default_delegate"<?php echo ($dperm & Kronolith::PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
     <label for="default_delegate" class="hidden"><?php echo _("Delegate") ?></label>
   </td>
   <td>&nbsp;</td>
 <tr>
   <td class="light">&nbsp;</td>
   <td align="center">
-    <input type="checkbox" id="guest_show" name="guest_show"<?php echo ($gperm & PERMS_SHOW) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="guest_show" name="guest_show"<?php echo ($gperm & Horde_Perms::SHOW) ? ' checked="checked"' : '' ?> />
     <label for="guest_show" class="hidden"><?php echo _("Show") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="guest_read" name="guest_read"<?php echo ($gperm & PERMS_READ) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="guest_read" name="guest_read"<?php echo ($gperm & Horde_Perms::READ) ? ' checked="checked"' : '' ?> />
     <label for="guest_read" class="hidden"><?php echo _("Read") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="guest_edit" name="guest_edit"<?php echo ($gperm & PERMS_EDIT) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="guest_edit" name="guest_edit"<?php echo ($gperm & Horde_Perms::EDIT) ? ' checked="checked"' : '' ?> />
     <label for="guest_edit" class="hidden"><?php echo _("Edit") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="guest_delete" name="guest_delete"<?php echo ($gperm & PERMS_DELETE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="guest_delete" name="guest_delete"<?php echo ($gperm & Horde_Perms::DELETE) ? ' checked="checked"' : '' ?> />
     <label for="guest_delete" class="hidden"><?php echo _("Delete") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="guest_delegate" name="guest_delegate"<?php echo ($gperm & PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="guest_delegate" name="guest_delegate"<?php echo ($gperm & Kronolith::PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
     <label for="guest_delegate" class="hidden"><?php echo _("Delegate") ?></label>
   </td>
   <td>&nbsp;</td>
 <tr>
   <td class="light">&nbsp;</td>
   <td align="center">
-    <input type="checkbox" id="creator_show"  name="creator_show"<?php echo ($cperm & PERMS_SHOW) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="creator_show"  name="creator_show"<?php echo ($cperm & Horde_Perms::SHOW) ? ' checked="checked"' : '' ?> />
     <label for="creator_show" class="hidden"><?php echo _("Show") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="creator_read" name="creator_read"<?php echo ($cperm & PERMS_READ) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="creator_read" name="creator_read"<?php echo ($cperm & Horde_Perms::READ) ? ' checked="checked"' : '' ?> />
     <label for="creator_read" class="hidden"><?php echo _("Read") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="creator_edit" name="creator_edit"<?php echo ($cperm & PERMS_EDIT) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="creator_edit" name="creator_edit"<?php echo ($cperm & Horde_Perms::EDIT) ? ' checked="checked"' : '' ?> />
     <label for="creator_edit" class="hidden"><?php echo _("Edit") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="creator_delete" name="creator_delete"<?php echo ($cperm & PERMS_DELETE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="creator_delete" name="creator_delete"<?php echo ($cperm & Horde_Perms::DELETE) ? ' checked="checked"' : '' ?> />
     <label for="creator_delete" class="hidden"><?php echo _("Delete") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="creator_delegate" name="creator_delegate"<?php echo ($cperm & PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="creator_delegate" name="creator_delegate"<?php echo ($cperm & Kronolith::PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
     <label for="creator_delegate" class="hidden"><?php echo _("Delegate") ?></label>
   </td>
   <td>&nbsp;</td>
@@ -186,23 +186,23 @@ foreach ($userperms as $user => $uperm) {
 <tr>
   <td class="light"><?php echo htmlspecialchars($user) ?><input type="hidden" name="u_names[<?php echo htmlspecialchars($user) ?>]" value="<?php echo htmlspecialchars($user) ?>" /></td>
   <td align="center">
-    <input type="checkbox" id="u_show_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_show[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & PERMS_SHOW) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="u_show_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_show[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & Horde_Perms::SHOW) ? ' checked="checked"' : '' ?> />
     <label for="u_show_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" class="hidden"><?php echo _("Show") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_read_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_read[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & PERMS_READ) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="u_read_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_read[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & Horde_Perms::READ) ? ' checked="checked"' : '' ?> />
     <label for="u_read_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" class="hidden"><?php echo _("Read") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_edit_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_edit[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & PERMS_EDIT) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="u_edit_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_edit[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & Horde_Perms::EDIT) ? ' checked="checked"' : '' ?> />
     <label for="u_edit_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" class="hidden"><?php echo _("Edit") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_delete_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_delete[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & PERMS_DELETE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="u_delete_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_delete[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & Horde_Perms::DELETE) ? ' checked="checked"' : '' ?> />
     <label for="u_delete_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" class="hidden"><?php echo _("Delete") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_delegate_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_delegate[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="u_delegate_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" name="u_delegate[<?php echo htmlspecialchars($user) ?>]"<?php echo ($uperm & Kronolith::PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
     <label for="u_delegate_<?php echo str_replace('@', '_', htmlspecialchars($user)) ?>" class="hidden"><?php echo _("Delegate") ?></label>
   </td>
   <td>&nbsp;</td>
@@ -299,23 +299,23 @@ foreach ($userList as $user) {
 <tr>
   <td class="light"><?php echo htmlspecialchars($groups->getGroupName($group)) ?><input type="hidden" name="g_names[<?php echo htmlspecialchars($group) ?>]" value="<?php echo htmlspecialchars($group) ?>" /></td>
   <td align="center">
-    <input type="checkbox" id="g_show_<?php echo htmlspecialchars($group) ?>" name="g_show[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & PERMS_SHOW) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="g_show_<?php echo htmlspecialchars($group) ?>" name="g_show[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & Horde_Perms::SHOW) ? ' checked="checked"' : '' ?> />
     <label for="g_show_<?php echo htmlspecialchars($group) ?>" class="hidden"><?php echo _("Show") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="g_read_<?php echo htmlspecialchars($group) ?>" name="g_read[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & PERMS_READ) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="g_read_<?php echo htmlspecialchars($group) ?>" name="g_read[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & Horde_Perms::READ) ? ' checked="checked"' : '' ?> />
     <label for="g_read_<?php echo htmlspecialchars($group) ?>" class="hidden"><?php echo _("Read") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="g_edit_<?php echo htmlspecialchars($group) ?>" name="g_edit[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & PERMS_EDIT) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="g_edit_<?php echo htmlspecialchars($group) ?>" name="g_edit[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & Horde_Perms::EDIT) ? ' checked="checked"' : '' ?> />
     <label for="g_edit_<?php echo htmlspecialchars($group) ?>" class="hidden"><?php echo _("Edit") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="g_delete_<?php echo htmlspecialchars($group) ?>" name="g_delete[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & PERMS_DELETE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="g_delete_<?php echo htmlspecialchars($group) ?>" name="g_delete[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & Horde_Perms::DELETE) ? ' checked="checked"' : '' ?> />
     <label for="g_delete_<?php echo htmlspecialchars($group) ?>" class="hidden"><?php echo _("Delete") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="g_delegate_<?php echo htmlspecialchars($group) ?>" name="g_delegate[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
+    <input type="checkbox" id="g_delegate_<?php echo htmlspecialchars($group) ?>" name="g_delegate[<?php echo htmlspecialchars($group) ?>]"<?php echo ($gperm & Kronolith::PERMS_DELEGATE) ? ' checked="checked"' : '' ?> />
     <label for="g_delegate_<?php echo htmlspecialchars($group) ?>" class="hidden"><?php echo _("Delegate") ?></label>
   </td>
   <td>&nbsp;</td>
index 80f8de3..c6c583b 100644 (file)
@@ -18,7 +18,7 @@ echo Horde::link($this->link(1), _("Next week"), 'iconNav', '', 'return ShowView
   <th class="control" width="1%">&nbsp;</th>
   <th class="nowrap <?php echo ($day->isToday() ? 'selected-control' : 'control') ?>" width="<?php echo $colwidth ?>%" colspan="<?php echo $day->_totalspan ?>">
 <?php
-if (Kronolith::getDefaultCalendar(PERMS_EDIT) &&
+if (Kronolith::getDefaultCalendar(Horde_Perms::EDIT) &&
     (!empty($conf['hooks']['permsdenied']) ||
      Kronolith::hasPermission('max_events') === true ||
      Kronolith::hasPermission('max_events') > Kronolith::countEvents())) {
index 5878b4e..3137b0d 100644 (file)
@@ -31,13 +31,13 @@ if (is_a($share, 'PEAR_Error')) {
 }
 
 // First try guest permissions.
-if (!$share->hasPermission('', PERMS_READ)) {
+if (!$share->hasPermission('', Horde_Perms::READ)) {
     // Authenticate.
     $auth = Horde_Auth::singleton($conf['auth']['driver']);
     if (!isset($_SERVER['PHP_AUTH_USER']) ||
         !$auth->authenticate($_SERVER['PHP_AUTH_USER'],
                              array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)) ||
-        !$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
         header('WWW-Authenticate: Basic realm="Nag iCalendar Interface"');
         header('HTTP/1.0 401 Unauthorized');
         echo '401 Unauthorized';
index cdbfa53..40af573 100644 (file)
@@ -160,7 +160,7 @@ class Nag_Api extends Horde_Registry_Api
             // This request is for a list of all users who have tasklists visible
             // to the requesting user.
             //
-            $tasklists = Nag::listTasklists(false, PERMS_READ);
+            $tasklists = Nag::listTasklists(false, Horde_Perms::READ);
             $owners = array();
             foreach ($tasklists as $tasklist) {
                 $owners[$tasklist->get('owner')] = true;
@@ -200,7 +200,7 @@ class Nag_Api extends Horde_Registry_Api
             // This request is for all tasklists owned by the requested user
             //
             $tasklists = $GLOBALS['nag_shares']->listShares($parts[0],
-                PERMS_SHOW,
+                Horde_Perms::SHOW,
                 $parts[0]);
 
             // The last check returns all addressbooks for the requested user,
@@ -221,7 +221,7 @@ class Nag_Api extends Horde_Registry_Api
                     $results[$retpath . '.ics']['icon'] = $registry->getImageDir() . '/mime/icalendar.png';
                 }
                 if (in_array('browseable', $properties)) {
-                    $results[$retpath]['browseable'] = $tasklist->hasPermission(Horde_Auth::getAuth(), PERMS_READ);
+                    $results[$retpath]['browseable'] = $tasklist->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ);
                     $results[$retpath . '.ics']['browseable'] = false;
                 }
                 if (in_array('contenttype', $properties)) {
@@ -250,7 +250,7 @@ class Nag_Api extends Horde_Registry_Api
             // This is a request for the entire tasklist in iCalendar format.
             //
             $tasklist = substr($parts[1], 0, -4);
-            if (!array_key_exists($tasklist, Nag::listTasklists(false, PERMS_READ))) {
+            if (!array_key_exists($tasklist, Nag::listTasklists(false, Horde_Perms::READ))) {
                 return PEAR::raiseError(_("Invalid tasklist file requested."), 404);
             }
             $ical_data = $this->exportTasklist($tasklist, 'text/calendar');
@@ -266,7 +266,7 @@ class Nag_Api extends Horde_Registry_Api
             // This request is browsing into a specific tasklist.  Generate the list
             // of items and represent them as files within the directory.
             //
-            if (!array_key_exists($parts[1], Nag::listTasklists(false, PERMS_READ))) {
+            if (!array_key_exists($parts[1], Nag::listTasklists(false, Horde_Perms::READ))) {
                 return PEAR::raiseError(_("Invalid tasklist requested."), 404);
             }
             $storage = Nag_Driver::singleton($parts[1]);
@@ -316,7 +316,7 @@ class Nag_Api extends Horde_Registry_Api
             //
             if (count($parts) == 3 &&
                 array_key_exists($parts[1], Nag::listTasklists(false,
-                    PERMS_READ))) {
+                    Horde_Perms::READ))) {
                         //
                         // This request is for a specific item within a given task list.
                         //
@@ -342,7 +342,7 @@ class Nag_Api extends Horde_Registry_Api
                         return $result;
                     } elseif (count($parts) == 2 &&
                         substr($parts[1], -4) == '.ics' &&
-                        array_key_exists(substr($parts[1], 0, -4), Nag::listTasklists(false, PERMS_READ))) {
+                        array_key_exists(substr($parts[1], 0, -4), Nag::listTasklists(false, Horde_Perms::READ))) {
                         } else {
                             //
                             // All other requests are a 404: Not Found
@@ -393,7 +393,7 @@ class Nag_Api extends Horde_Registry_Api
                 return PEAR::raiseError(_("Invalid tasklist name supplied."), 403);
             }
 
-        if (!array_key_exists($tasklist, Nag::listTasklists(false, PERMS_EDIT))) {
+        if (!array_key_exists($tasklist, Nag::listTasklists(false, Horde_Perms::EDIT))) {
             // FIXME: Should we attempt to create a tasklist based on the filename
             // in the case that the requested tasklist does not exist?
             return PEAR::raiseError(_("Tasklist does not exist or no permission to edit"), 403);
@@ -517,7 +517,7 @@ class Nag_Api extends Horde_Registry_Api
                 return PEAR::raiseError(sprintf(_("Unsupported Content-Type: %s"), $content_type), 400);
         }
 
-        if (array_key_exists($tasklist, Nag::listTasklists(false, PERMS_DELETE))) {
+        if (array_key_exists($tasklist, Nag::listTasklists(false, Horde_Perms::DELETE))) {
             foreach (array_keys($uids_remove) as $uid) {
                 $this->delete($uid);
             }
@@ -559,7 +559,7 @@ class Nag_Api extends Horde_Registry_Api
         }
 
         if (!(count($parts) == 2 || count($parts) == 3) ||
-            !array_key_exists($tasklistID, Nag::listTasklists(false, PERMS_DELETE))) {
+            !array_key_exists($tasklistID, Nag::listTasklists(false, Horde_Perms::DELETE))) {
                 return PEAR::raiseError(_("Tasklist does not exist or no permission to delete"), 403);
             }
 
@@ -626,11 +626,11 @@ class Nag_Api extends Horde_Registry_Api
         }
 
         if ($tasklist === null) {
-            $tasklist = Nag::getDefaultTasklist(PERMS_READ);
+            $tasklist = Nag::getDefaultTasklist(Horde_Perms::READ);
         }
 
         if (!array_key_exists($tasklist,
-            Nag::listTasklists(false, PERMS_READ))) {
+            Nag::listTasklists(false, Horde_Perms::READ))) {
                 return PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -664,11 +664,11 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if ($tasklist === null) {
-            $tasklist = Nag::getDefaultTasklist(PERMS_READ);
+            $tasklist = Nag::getDefaultTasklist(Horde_Perms::READ);
         }
 
         if (!array_key_exists($tasklist,
-            Nag::listTasklists(false, PERMS_READ))) {
+            Nag::listTasklists(false, Horde_Perms::READ))) {
                 return PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -697,11 +697,11 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if ($tasklist === null) {
-            $tasklist = Nag::getDefaultTasklist(PERMS_READ);
+            $tasklist = Nag::getDefaultTasklist(Horde_Perms::READ);
         }
 
         if (!array_key_exists($tasklist,
-            Nag::listTasklists(false, PERMS_READ))) {
+            Nag::listTasklists(false, Horde_Perms::READ))) {
                 return PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -731,10 +731,10 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if ($tasklist === null) {
-            $tasklist = Nag::getDefaultTasklist(PERMS_EDIT);
+            $tasklist = Nag::getDefaultTasklist(Horde_Perms::EDIT);
         }
 
-        if (!array_key_exists($tasklist, Nag::listTasklists(false, PERMS_EDIT))) {
+        if (!array_key_exists($tasklist, Nag::listTasklists(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -838,9 +838,9 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if ($tasklist === null) {
-            $tasklist = Nag::getDefaultTasklist(PERMS_EDIT);
+            $tasklist = Nag::getDefaultTasklist(Horde_Perms::EDIT);
         }
-        if (!array_key_exists($tasklist, Nag::listTasklists(false, PERMS_EDIT))) {
+        if (!array_key_exists($tasklist, Nag::listTasklists(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -858,7 +858,7 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if (!array_key_exists($tasklist_id,
-            Nag::listTasklists(false, PERMS_EDIT))) {
+            Nag::listTasklists(false, Horde_Perms::EDIT))) {
                 return PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -907,7 +907,7 @@ class Nag_Api extends Horde_Registry_Api
         }
 
         if (!array_key_exists($task->tasklist,
-                              Nag::listTasklists(false, PERMS_READ))) {
+                              Nag::listTasklists(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -947,7 +947,7 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if (!array_key_exists($tasklist,
-                              Nag::listTasklists(false, PERMS_READ))) {
+                              Nag::listTasklists(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -975,7 +975,7 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         if (!array_key_exists($tasklist,
-            Nag::listTasklists(false, PERMS_READ))) {
+            Nag::listTasklists(false, Horde_Perms::READ))) {
                 return PEAR::raiseError(_("Permission Denied"));
             }
 
@@ -1036,7 +1036,7 @@ class Nag_Api extends Horde_Registry_Api
 
         if (!Horde_Auth::isAdmin() &&
             !array_key_exists($task->tasklist,
-                              Nag::listTasklists(false, PERMS_DELETE))) {
+                              Nag::listTasklists(false, Horde_Perms::DELETE))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -1055,7 +1055,7 @@ class Nag_Api extends Horde_Registry_Api
 
         if (!Horde_Auth::isAdmin() &&
             !array_key_exists($tasklist,
-                              Nag::listTasklists(false, PERMS_DELETE))) {
+                              Nag::listTasklists(false, Horde_Perms::DELETE))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -1091,7 +1091,7 @@ class Nag_Api extends Horde_Registry_Api
         }
         $taskId = $existing->id;
 
-        if (!array_key_exists($existing->tasklist, Nag::listTasklists(false, PERMS_EDIT))) {
+        if (!array_key_exists($existing->tasklist, Nag::listTasklists(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -1160,7 +1160,7 @@ class Nag_Api extends Horde_Registry_Api
 
         if (!Horde_Auth::isAdmin() &&
             !array_key_exists($tasklist,
-                              Nag::listTasklists(false, PERMS_EDIT))) {
+                              Nag::listTasklists(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -1225,7 +1225,7 @@ class Nag_Api extends Horde_Registry_Api
         require_once dirname(__FILE__) . '/base.php';
 
         $categories = array();
-        $tasklists = Nag::listTasklists(false, PERMS_SHOW | PERMS_READ);
+        $tasklists = Nag::listTasklists(false, Horde_Perms::SHOW | Horde_Perms::READ);
         foreach ($tasklists as $tasklistId => $tasklist) {
             $categories[$tasklistId] = $tasklist->get('name');
         }
@@ -1244,7 +1244,7 @@ class Nag_Api extends Horde_Registry_Api
     {
         require_once dirname(__FILE__) . '/base.php';
 
-        $allowed_tasklists = Nag::listTasklists(false, PERMS_READ);
+        $allowed_tasklists = Nag::listTasklists(false, Horde_Perms::READ);
         foreach ($categories as $tasklist) {
             if (!array_key_exists($tasklist, $allowed_tasklists)) {
                 return PEAR::raiseError(_("Permission Denied"));
@@ -1315,8 +1315,8 @@ class Nag_Api extends Horde_Registry_Api
                 continue;
             }
             if (empty($user)) {
-                $users = $share->listUsers(PERMS_READ);
-                $groups = $share->listGroups(PERMS_READ);
+                $users = $share->listUsers(Horde_Perms::READ);
+                $groups = $share->listGroups(Horde_Perms::READ);
                 foreach ($groups as $gid) {
                     $users = array_merge($users, $group->listUsers($gid));
                 }
index d45efae..9b33503 100644 (file)
@@ -141,7 +141,7 @@ class Horde_Block_nag_summary extends Horde_Block {
             null, null, null,
             isset($this->_params['show_tasklists'])
                 ? $this->_params['show_tasklists']
-            : array_keys(Nag::listTasklists(false, PERMS_READ)),
+            : array_keys(Nag::listTasklists(false, Horde_Perms::READ)),
             empty($this->_params['show_completed']) ? 0 : 1);
         if (is_a($tasks, 'PEAR_Error')) {
             return '<em>' . htmlspecialchars($tasks->getMessage()) . '</em>';
index 2431c75..86cff9a 100644 (file)
@@ -326,7 +326,7 @@ class Nag_Driver
                 return $share;
             }
 
-            if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+            if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
                 $GLOBALS['notification']->push(sprintf(_("Access denied removing task from %s."), $share->get('name')), 'horde.error');
                 return false;
             }
@@ -336,7 +336,7 @@ class Nag_Driver
                 return $share;
             }
 
-            if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                 $GLOBALS['notification']->push(sprintf(_("Access denied moving the task to %s."), $share->get('name')), 'horde.error');
             }
 
index 4719569..2c29872 100644 (file)
@@ -26,7 +26,7 @@ class Nag_TaskForm extends Horde_Form {
         parent::Horde_Form($vars, $title);
         $this->delete = $delete;
 
-        $tasklists = Nag::listTasklists(false, PERMS_EDIT);
+        $tasklists = Nag::listTasklists(false, Horde_Perms::EDIT);
         $tasklist_enums = array();
         foreach ($tasklists as $tl_id => $tl) {
             $tasklist_enums[$tl_id] = $tl->get('name');
@@ -49,8 +49,8 @@ class Nag_TaskForm extends Horde_Form {
         $users = array();
         $share = &$GLOBALS['nag_shares']->getShare($tasklist);
         if (!is_a($share, 'PEAR_Error')) {
-            $users = $share->listUsers(PERMS_READ);
-            $groups = $share->listGroups(PERMS_READ);
+            $users = $share->listUsers(Horde_Perms::READ);
+            $groups = $share->listGroups(Horde_Perms::READ);
             if (count($groups)) {
                 require_once 'Horde/Group.php';
                 $horde_group = &Group::singleton();
index 9697869..47f81ba 100644 (file)
@@ -245,7 +245,7 @@ class Nag
             return $count;
         }
 
-        $tasklists = Nag::listTasklists(true, PERMS_ALL);
+        $tasklists = Nag::listTasklists(true, Horde_Perms::ALL);
 
         $count = 0;
         foreach (array_keys($tasklists) as $tasklist) {
@@ -273,9 +273,9 @@ class Nag
     public static function createTasksFromText($text, $tasklist = null)
     {
         if ($tasklist === null) {
-            $tasklist = Nag::getDefaultTasklist(PERMS_EDIT);
+            $tasklist = Nag::getDefaultTasklist(Horde_Perms::EDIT);
         }
-        if (!array_key_exists($tasklist, Nag::listTasklists(false, PERMS_EDIT))) {
+        if (!array_key_exists($tasklist, Nag::listTasklists(false, Horde_Perms::EDIT))) {
             return PEAR::raiseError(_("Permission Denied"));
         }
 
@@ -362,7 +362,7 @@ class Nag
      *
      * @return array  The task lists.
      */
-    function listTasklists($owneronly = false, $permission = PERMS_SHOW)
+    function listTasklists($owneronly = false, $permission = Horde_Perms::SHOW)
     {
         $tasklists = $GLOBALS['nag_shares']->listShares(Horde_Auth::getAuth(), $permission, $owneronly ? Horde_Auth::getAuth() : null, 0, 0, 'name');
         if (is_a($tasklists, 'PEAR_Error')) {
@@ -378,11 +378,12 @@ class Nag
      *
      * @param array $in            The data we want filtered.
      * @param string $filter       What type of data we are filtering.
-     * @param integer $permission  The PERMS_* constant we will filter on.
+     * @param integer $permission  The Horde_Perms::* constant we will filter
+     *                             on.
      *
      * @return array  The filtered data.
      */
-    function permissionsFilter($in, $permission = PERMS_READ)
+    function permissionsFilter($in, $permission = Horde_Perms::READ)
     {
         // FIXME: Must find a way to check individual tasklists for
         // permission.  Can't specify attributes as it does not check for the
@@ -405,7 +406,7 @@ class Nag
      * Returns the default tasklist for the current user at the specified
      * permissions level.
      */
-    function getDefaultTasklist($permission = PERMS_SHOW)
+    function getDefaultTasklist($permission = Horde_Perms::SHOW)
     {
         global $prefs;
 
@@ -655,7 +656,7 @@ class Nag
                 $GLOBALS['display_tasklists'] = array_keys($lists);
             } else {
                 /* Make sure at least the default tasklist is visible. */
-                $default_tasklist = Nag::getDefaultTasklist(PERMS_READ);
+                $default_tasklist = Nag::getDefaultTasklist(Horde_Perms::READ);
                 if ($default_tasklist) {
                     $GLOBALS['display_tasklists'] = array($default_tasklist);
                 }
@@ -692,7 +693,7 @@ class Nag
 
         $menu = new Horde_Menu();
         $menu->add(Horde::applicationUrl('list.php'), _("_List Tasks"), 'nag.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
-        if (Nag::getDefaultTasklist(PERMS_EDIT) &&
+        if (Nag::getDefaultTasklist(Horde_Perms::EDIT) &&
             (!empty($conf['hooks']['permsdenied']) ||
              Nag::hasPermission('max_tasks') === true ||
              Nag::hasPermission('max_tasks') > Nag::countTasks())) {
@@ -788,12 +789,12 @@ class Nag
         $owner = $share->get('owner');
         $recipients[$owner] = Nag::_notificationPref($owner, 'owner');
 
-        foreach ($share->listUsers(PERMS_READ) as $user) {
+        foreach ($share->listUsers(Horde_Perms::READ) as $user) {
             if (empty($recipients[$user])) {
                 $recipients[$user] = Nag::_notificationPref($user, 'read', $task->tasklist);
             }
         }
-        foreach ($share->listGroups(PERMS_READ) as $group) {
+        foreach ($share->listGroups(Horde_Perms::READ) as $group) {
             $group = $groups->getGroupById($group);
             if (is_a($group, 'PEAR_Error')) {
                 continue;
index 047d8e9..0482c41 100644 (file)
@@ -20,7 +20,7 @@ function _delete($task_id, $tasklist_id)
         } else {
             $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
             if (is_a($share, 'PEAR_Error') ||
-                !$share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+                !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
                 $GLOBALS['notification']->push(
                     _("Access denied deleting task."), 'horde.error');
             } else {
@@ -74,7 +74,7 @@ case 'add_task':
 
     $vars->set('actionID', 'save_task');
     if (!$vars->exists('tasklist_id')) {
-        $vars->set('tasklist_id', Nag::getDefaultTasklist(PERMS_EDIT));
+        $vars->set('tasklist_id', Nag::getDefaultTasklist(Horde_Perms::EDIT));
     }
     $form = new Nag_TaskForm($vars, _("New Task"));
     break;
@@ -85,7 +85,7 @@ case 'modify_task':
     $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
     if (is_a($share, 'PEAR_Error')) {
         $notification->push(sprintf(_("Access denied editing task: %s"), $share->getMessage()), 'horde.error');
-    } elseif (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    } elseif (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(_("Access denied editing task."), 'horde.error');
     } else {
         $task = Nag::getTask($tasklist_id, $task_id);
@@ -97,7 +97,7 @@ case 'modify_task':
             $vars = new Horde_Variables($task->toHash());
             $vars->set('actionID', 'save_task');
             $vars->set('old_tasklist', $task->tasklist);
-            $form = new Nag_TaskForm($vars, sprintf(_("Edit: %s"), $task->name), $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE));
+            $form = new Nag_TaskForm($vars, sprintf(_("Edit: %s"), $task->name), $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE));
             break;
         }
     }
@@ -118,15 +118,15 @@ case 'save_task':
 
     $form->getInfo($vars, $info);
     if ($prefs->isLocked('default_tasklist') ||
-        count(Nag::listTasklists(false, PERMS_EDIT)) <= 1) {
-        $info['tasklist_id'] = $info['old_tasklist'] = Nag::getDefaultTasklist(PERMS_EDIT);
+        count(Nag::listTasklists(false, Horde_Perms::EDIT)) <= 1) {
+        $info['tasklist_id'] = $info['old_tasklist'] = Nag::getDefaultTasklist(Horde_Perms::EDIT);
     }
     $share = $GLOBALS['nag_shares']->getShare($info['tasklist_id']);
     if (is_a($share, 'PEAR_Error')) {
         $notification->push(sprintf(_("Access denied saving task: %s"), $share->getMessage()), 'horde.error');
         header('Location: ' . Horde::applicationUrl('list.php', true));
         exit;
-    } elseif (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    } elseif (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         $notification->push(sprintf(_("Access denied saving task to %s."), $share->get('name')), 'horde.error');
         header('Location: ' . Horde::applicationUrl('list.php', true));
         exit;
@@ -198,7 +198,7 @@ case 'complete_task':
     if (isset($task_id)) {
         $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
         $task = Nag::getTask($tasklist_id, $task_id);
-        if (is_a($share, 'PEAR_Error') || !$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+        if (is_a($share, 'PEAR_Error') || !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             $notification->push(sprintf(_("Access denied completing task %s."), $task->name), 'horde.error');
         } else {
             $task->completed = !$task->completed;
index cd36091..1e9cbf7 100644 (file)
@@ -15,7 +15,7 @@
   </select>
  </p>
 
- <?php if (count($tasklists = Nag::listTasklists(false, PERMS_READ)) > 1): ?>
+ <?php if (count($tasklists = Nag::listTasklists(false, Horde_Perms::READ)) > 1): ?>
  <p>
   <?php echo Horde::label('exportList', _("Select the task list(s) to export from:")) ?><br />
   <select id="exportList" name="exportList[]" multiple="multiple">
@@ -25,7 +25,7 @@
   </select>
  </p>
  <?php else: ?>
- <input type="hidden" name="exportList[]" value="<?php echo htmlspecialchars(Nag::getDefaultTasklist(PERMS_READ)) ?>" />
+ <input type="hidden" name="exportList[]" value="<?php echo htmlspecialchars(Nag::getDefaultTasklist(Horde_Perms::READ)) ?>" />
  <?php endif; ?>
 
  <p>
index 2d435b4..182f5ac 100644 (file)
   </select>
  </p>
 
-<?php if (!$prefs->isLocked('default_tasklist') && count($tasklists = Nag::listTasklists(false, PERMS_EDIT)) > 1): ?>
+<?php if (!$prefs->isLocked('default_tasklist') && count($tasklists = Nag::listTasklists(false, Horde_Perms::EDIT)) > 1): ?>
  <p>
   <?php echo Horde::label('tasklist_target', _("Which tasklist should the tasks be added to?")) ?><br />
   <select id="tasklist_target" name="tasklist_target">
   <?php
-  $default = Nag::getDefaultTasklist(PERMS_EDIT);
+  $default = Nag::getDefaultTasklist(Horde_Perms::EDIT);
   foreach ($tasklists as $id => $tasklist) {
       $sel = ($id == $default) ? ' selected="selected"' : '';
       printf('<option value="%s"%s>%s</option>',
@@ -30,7 +30,7 @@
   </select>
  </p>
 <?php else: ?>
- <input type="hidden" name="tasklist_target" value="<?php echo htmlspecialchars(Nag::getDefaultTasklist(PERMS_EDIT)) ?>" />
+ <input type="hidden" name="tasklist_target" value="<?php echo htmlspecialchars(Nag::getDefaultTasklist(Horde_Perms::EDIT)) ?>" />
 <?php endif; ?>
  <p>
   <?php echo Horde::label('import_file', _("Select the file to import:")) ?><br />
index 7f00c07..c44a821 100644 (file)
@@ -2,7 +2,7 @@
   <td>
 <?php
 if (!is_a($share, 'PEAR_Error') &&
-    $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     if (!$task->completed) {
         if (!$task->childrenCompleted()) {
             $label = _("Incomplete sub tasks, complete them first");
@@ -34,7 +34,7 @@ if (!is_a($share, 'PEAR_Error') &&
   <td>
     <?php
     if (!is_a($share, 'PEAR_Error') &&
-        $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT) &&
+        $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT) &&
         (!$task->private || $task->owner == Horde_Auth::getAuth())) {
         $label = sprintf(_("Edit \"%s\""), $task->name);
         echo Horde::link($task->edit_link, $label) . Horde::img('edit.png', $label, null, $registry->getImageDir('horde')) . '</a>';
@@ -48,7 +48,7 @@ if (!is_a($share, 'PEAR_Error') &&
         ? htmlspecialchars($task->name)
         : _("[none]");
     if (!is_a($share, 'PEAR_Error') &&
-        $share->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+        $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
         echo Horde::link($task->view_link, '', '', '', '', $task->desc)
             . $task_name . '</a>';
     } else {
index d23319c..1576a76 100644 (file)
@@ -41,7 +41,7 @@
  <tr>
   <td class="rightAlign" valign="top"><strong><?php echo _("Completed?") ?></strong></td>
   <td>
-  <?php if (!is_a($share, 'PEAR_Error') && $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+  <?php if (!is_a($share, 'PEAR_Error') && $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
             if (empty($task->completed)) {
                 echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'complete_task')), _("Complete Task"), 'widget') . Horde::img('unchecked.png', _("Complete Task")) . '</a>';
             } else {
index e07c86e..9986360 100644 (file)
@@ -46,7 +46,7 @@ $task->loadChildren();
 
 /* Check permissions on $tasklist_id. */
 $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
-if (is_a($share, 'PEAR_Error') || !$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (is_a($share, 'PEAR_Error') || !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     $notification->push(_("You do not have permission to view this tasklist."), 'horde.error');
     header('Location: ' . Horde::applicationUrl('list.php', true));
     exit;
@@ -102,7 +102,7 @@ $taskurl = Horde_Util::addParameter('task.php',
 $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
 
 if (!is_a($share, 'PEAR_Error')) {
-    if ($share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+    if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
         if (!$task->completed) {
             $links[] = Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'complete_task')), _("Complete"), 'smallheader', '', '', _("_Complete"));
         }
@@ -110,7 +110,7 @@ if (!is_a($share, 'PEAR_Error')) {
             $links[] = Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'modify_task')), _("Edit"), 'smallheader', '', '', _("_Edit"));
         }
     }
-    if ($share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+    if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
         $links[] = Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($taskurl, 'actionID', 'delete_tasks')), _("Delete"), 'smallheader', '', $prefs->getValue('delete_opt') ? 'return window.confirm(\'' . addslashes(_("Really delete this task?")) . '\');' : '', _("_Delete"));
     }
 }
index b05900d..52e4872 100644 (file)
@@ -272,7 +272,7 @@ if (Horde_Auth::isAdmin('news:admin')) {
 if ($form->validate()) {
 
     $status_inserted = false;
-    $allowed_cats = $news_cat->getAllowed(PERMS_DELETE);
+    $allowed_cats = $news_cat->getAllowed(Horde_Perms::DELETE);
     $form->getInfo(null, $info);
 
     // Check permissions
index 702c1e3..22c3b5e 100644 (file)
@@ -16,7 +16,7 @@
 require_once dirname(__FILE__) . '/lib/base.php';
 
 // redirect if not an admin
-$allowed_cats = $news_cat->getAllowed(PERMS_DELETE);
+$allowed_cats = $news_cat->getAllowed(Horde_Perms::DELETE);
 if (empty($allowed_cats)) {
     $notification->push(_("You have not editor permission on any category."));
     header('Location: ' . Horde::applicationUrl('add.php'));
@@ -157,7 +157,7 @@ $form = new News_Search($vars);
 $form->getInfo(null, $info);
 
 /* prepare query */
-$binds = $news->buildQuery(PERMS_DELETE, $info);
+$binds = $news->buildQuery(Horde_Perms::DELETE, $info);
 $sql = 'SELECT n.id, n.sortorder, n.category1, n.category2, n.source, n.status, n.editor, n.publish, ' .
        'n.user, n.comments, n.unpublish, n.picture, n.chars, n.view_count, n.attachments, l.title, n.selling '
        . $binds[0];
@@ -172,7 +172,7 @@ if (!isset($info['sort_dir'])) {
 $sql .= ' ORDER BY ' . $info['sort_by'] . ' ' . $info['sort_dir'];
 
 // Count rows
-$count = $news->countNews($info, PERMS_DELETE);
+$count = $news->countNews($info, Horde_Perms::DELETE);
 if ($count instanceof PEAR_Error) {
     echo $count->getMessage() . ': ' . $count->getDebugInfo();
     exit;
index 491cdd4..6ea6b22 100644 (file)
@@ -77,7 +77,7 @@ class News_Api extends Horde_Registry_Api
      *
      * @return array | PEAR_Error  True on success, PEAR_Error on failure.
      */
-    public function listNews($criteria = array(), $from = 0, $count = 0, $perms = PERMS_READ)
+    public function listNews($criteria = array(), $from = 0, $count = 0, $perms = Horde_Perms::READ)
     {
         require_once dirname(__FILE__) . '/base.php';
 
@@ -92,7 +92,7 @@ class News_Api extends Horde_Registry_Api
      *
      * @return integer | PEAR_Error  True on success, PEAR_Error on failure.
      */
-    public function countNews($criteria = array(), $perms = PERMS_READ)
+    public function countNews($criteria = array(), $perms = Horde_Perms::READ)
     {
         require_once dirname(__FILE__) . '/base.php';
 
index 2c7727f..698cde2 100644 (file)
@@ -235,7 +235,7 @@ class News_Categories {
      *
      * @return string  The current language.
      */
-    public function getAllowed($perm = PERMS_SHOW)
+    public function getAllowed($perm = Horde_Perms::SHOW)
     {
         $cats = $this->getCategories();
         if (Horde_Auth::isAdmin('news:admin') ||
index e8fad41..1fdbb39 100644 (file)
@@ -438,7 +438,7 @@ class News_Driver_sql extends News_Driver {
    /**
      * Build whare search
      */
-    public function buildQuery($perms = PERMS_READ, $criteria = array())
+    public function buildQuery($perms = Horde_Perms::READ, $criteria = array())
     {
         static $parts;
 
@@ -451,7 +451,7 @@ class News_Driver_sql extends News_Driver {
             . ' WHERE n.id = l.id AND l.lang = ?';
         $params = array('_lang' => Horde_Nls::select());
 
-        if ($perms == PERMS_READ) {
+        if ($perms == Horde_Perms::READ) {
             $sql .= ' AND n.publish <= ? ';
             $params['_perms'] = date('Y-m-d H:i:s');
             $sql .= ' AND n.status = ? ';
@@ -527,7 +527,7 @@ class News_Driver_sql extends News_Driver {
      *
      * @return Nimber of news
      */
-    public function countNews($criteria = array(), $perms = PERMS_READ)
+    public function countNews($criteria = array(), $perms = Horde_Perms::READ)
     {
         $binds = $this->buildQuery($perms, $criteria);
         $binds[0] = 'SELECT COUNT(*) ' . $binds[0];
@@ -545,7 +545,7 @@ class News_Driver_sql extends News_Driver {
      *
      * @return array of news data
      */
-    public function listNews($criteria = array(), $from = 0, $count = 0, $perms = PERMS_READ)
+    public function listNews($criteria = array(), $from = 0, $count = 0, $perms = Horde_Perms::READ)
     {
         $binds = $this->buildQuery($perms, $criteria);
 
index 53c33f3..09f9786 100644 (file)
@@ -27,7 +27,7 @@ class News_Search extends Horde_Form {
                    News::LOCKED => _("Locked"));
         $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, _("-- select --")));
 
-        $allowed_cats = $GLOBALS['news_cat']->getAllowed(PERMS_DELETE);
+        $allowed_cats = $GLOBALS['news_cat']->getAllowed(Horde_Perms::DELETE);
         $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, _("-- select --")));
 
         $sources = $GLOBALS['news']->getSources();
index ea01602..6b9fc4c 100644 (file)
@@ -418,7 +418,7 @@ class News {
             return unserialize($images);
         }
 
-        $images = $GLOBALS['registry']->call('images/listImages', array('ansel', $id, PERMS_SHOW, 'thumb'));
+        $images = $GLOBALS['registry']->call('images/listImages', array('ansel', $id, Horde_Perms::SHOW, 'thumb'));
         $GLOBALS['cache']->set("news_gallery_$id", serialize($images));
 
         return $images;
index 89cb70a..40677fd 100644 (file)
@@ -30,7 +30,7 @@ class News_Search extends Horde_Form {
                    News::LOCKED => _("Locked"));
         $this->addVariable(_("Status"), 'status', 'enum', false, false, false, array($s, _("-- select --")));
 
-        $allowed_cats = $GLOBALS['news_cat']->getAllowed(PERMS_DELETE);
+        $allowed_cats = $GLOBALS['news_cat']->getAllowed(Horde_Perms::DELETE);
         $this->addVariable(_("Category"), 'category', 'enum', false, false, false, array($allowed_cats, _("-- select --")));
 
         $sources = $GLOBALS['news']->getSources();
index b4c83cf..21e71ab 100644 (file)
@@ -15,7 +15,7 @@ require_once SKOLI_BASE . '/lib/base.php';
 require_once SKOLI_BASE . '/lib/Forms/Entry.php';
 
 /* Redirect to create a new class if we don't have access to any class */
-if (count(Skoli::listClasses(false, PERMS_EDIT)) == 0 && Horde_Auth::getAuth()) {
+if (count(Skoli::listClasses(false, Horde_Perms::EDIT)) == 0 && Horde_Auth::getAuth()) {
     $notification->push(_("Please create a new Class first."), 'horde.message');
     header('Location: ' . Horde::applicationUrl('classes/create.php', true));
     exit;
index 4aa9fe1..edada5f 100644 (file)
@@ -26,7 +26,7 @@ if (is_a($class, 'PEAR_Error')) {
     $notification->push($class, 'horde.error');
     header('Location: ' . Horde::applicationUrl('classes/', true));
     exit;
-} elseif (!$class->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+} elseif (!$class->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
     $notification->push(_("You are not allowed to delete this class."), 'horde.error');
     header('Location: ' . Horde::applicationUrl('classes/', true));
     exit;
index fe9aba5..58465d1 100644 (file)
@@ -24,7 +24,7 @@ if (is_a($class, 'PEAR_Error')) {
     $notification->push($class, 'horde.error');
     header('Location: ' . Horde::applicationUrl('classes/', true));
     exit;
-} elseif (!$class->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+} elseif (!$class->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $notification->push(_("You are not allowed to change this class."), 'horde.error');
     header('Location: ' . Horde::applicationUrl('classes/', true));
     exit;
index 5b509b9..cce363e 100644 (file)
@@ -31,7 +31,7 @@ if (is_a($entry, 'PEAR_Error') || !count($entry)) {
 $share = $GLOBALS['skoli_shares']->getShare($entry['class_id']);
 
 // Check permissions
-if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ)) {
+if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ)) {
     $notification->push(_("You are not allowed to view this entry."), 'horde.error');
     header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
     exit;
@@ -86,10 +86,10 @@ if ($actionID == 'delete') {
 $url = Horde_Util::addParameter(Horde::applicationUrl('entry.php'), 'entry', $entry['object_id']);
 $tabs = new Horde_Ui_Tabs('view', $vars);
 $tabs->addTab(_("View"), $url, array('tabname' => 'Entry', 'id' => 'tabEntry'));
-if ($share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
     $tabs->addTab(_("Edit"), $url, array('tabname' => 'EditEntry', 'id' => 'tabEditEntry'));
 }
-if ($share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)) {
+if ($share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
     $tabs->addTab(_("Delete"), $url, array('tabname' => 'DeleteEntry', 'id' => 'tabDeleteEntry'));
 }
 
index 3bf6437..ed52877 100644 (file)
@@ -21,7 +21,7 @@ class Horde_Block_skoli_tree_menu extends Horde_Block {
         $add = Horde::applicationUrl('add.php');
         $icondir = $registry->getImageDir();
 
-        $classes = Skoli::listClasses(false, PERMS_EDIT);
+        $classes = Skoli::listClasses(false, Horde_Perms::EDIT);
         if (count($classes) > 0) {
 
             $tree->addNode($parent . '__new',
index 2f0b0fd..cf914c2 100644 (file)
@@ -42,10 +42,10 @@ class Skoli_EntryForm extends Horde_Form {
             $this->addHidden('', 'view', 'text', true);
         }
 
-        $classes = Skoli::listClasses(false, PERMS_EDIT);
+        $classes = Skoli::listClasses(false, Horde_Perms::EDIT);
         $classes_enums = array();
         foreach ($classes as $class) {
-            if ($class->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
+            if ($class->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
                 $classes_enums[$class->getName()] = $class->get('name');
             }
         }
index 7c5832d..f45385c 100644 (file)
@@ -132,7 +132,7 @@ class Skoli {
      *
      * @return array  The class list.
      */
-    function listClasses($owneronly = false, $permission = PERMS_SHOW)
+    function listClasses($owneronly = false, $permission = Horde_Perms::SHOW)
     {
         global $registry;
 
@@ -208,13 +208,13 @@ class Skoli {
             $share = $GLOBALS['skoli_shares']->getShare($class);
 
             /* Check permissions */
-            if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ) || !isset($addressbooks[$share->get('address_book')])) {
+            if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
                 continue;
             }
 
             $list[$i] = $share->datatreeObject->data;
             $list[$i]['_id'] = $class;
-            $list[$i]['_edit'] = $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
+            $list[$i]['_edit'] = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
 
             /* Add all students to the list */
             $driver = &Skoli_Driver::singleton($class);
@@ -333,12 +333,12 @@ class Skoli {
         $addressbooks = $registry->call('contacts/sources');
         foreach ($classes as $class_id=>$share) {
             /* Check permissions */
-            if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_READ) || !isset($addressbooks[$share->get('address_book')])) {
+            if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::READ) || !isset($addressbooks[$share->get('address_book')])) {
                 continue;
             }
 
-            $share_permissions_edit = $share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT);
-            $share_permissions_delete = $share->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE);
+            $share_permissions_edit = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT);
+            $share_permissions_delete = $share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE);
 
             $driver = &Skoli_Driver::singleton($class_id);
             $entries = $driver->getEntries($studentid, $type, $searchparams);
@@ -492,7 +492,7 @@ class Skoli {
 
         $menu = new Horde_Menu(Horde_Menu::MASK_ALL);
         $menu->add(Horde::applicationUrl('list.php'), _("List Classes"), 'skoli.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
-        if (count(Skoli::listClasses(false, PERMS_EDIT))) {
+        if (count(Skoli::listClasses(false, Horde_Perms::EDIT))) {
             $menu->add(Horde::applicationUrl('add.php'), _("_New Entry"), 'add.png', null, null, null, Horde_Util::getFormData('entry') ? '__noselection' : null);
         }
 
@@ -508,7 +508,7 @@ class Skoli {
         /* Timetable.
          * Show this item only if an application provides 'calendar/show' and we have permissions to view it.
         $app = $registry->hasMethod('calendar/show');
-        if ($app !== false && $registry->get('status', $app) != 'inactive' && $registry->hasPermission($app, PERMS_EDIT)) {
+        if ($app !== false && $registry->get('status', $app) != 'inactive' && $registry->hasPermission($app, Horde_Perms::EDIT)) {
             $menu->add(Horde::applicationUrl(Horde_Util::addParameter('timetable.php', 'actionID', 'new_timetable')), _("_New Timetable"), 'timetable.png');
         }
         */
index 59caacc..08aaea3 100644 (file)
@@ -49,7 +49,7 @@ if (($sortby_student = Horde_Util::getFormData('sortby_student')) !== null) {
 
 /* Check if we have access to an application who provides contacts/getContact */
 $app = $registry->hasMethod('contacts/getContact');
-if ($app == false || $registry->get('status', $app) == 'inactive' || !$registry->hasPermission($app, PERMS_SHOW)) {
+if ($app == false || $registry->get('status', $app) == 'inactive' || !$registry->hasPermission($app, Horde_Perms::SHOW)) {
     $notification->push(_("Skoli needs an applications who provides contacts (e.g. turba)."), 'horde.warning');
 }
 
index 3e35fd9..7b0be53 100644 (file)
@@ -76,11 +76,11 @@ $url = $contact->url();
 $tabs = new Horde_Ui_Tabs('view', $vars);
 $tabs->addTab(_("_View"), $url,
               array('tabname' => 'Contact', 'id' => 'tabContact', 'onclick' => 'return ShowTab(\'Contact\');'));
-if ($contact->hasPermission(PERMS_EDIT)) {
+if ($contact->hasPermission(Horde_Perms::EDIT)) {
     $tabs->addTab(_("_Edit"), $url,
                   array('tabname' => 'EditContact', 'id' => 'tabEditContact', 'onclick' => 'return ShowTab(\'EditContact\');'));
 }
-if ($contact->hasPermission(PERMS_DELETE)) {
+if ($contact->hasPermission(Horde_Perms::DELETE)) {
     $tabs->addTab(_("De_lete"), $url,
                   array('tabname' => 'DeleteContact', 'id' => 'tabDeleteContact', 'onclick' => 'return ShowTab(\'DeleteContact\');'));
 }
index 4898ed8..2fbe3fb 100644 (file)
@@ -516,7 +516,7 @@ if ($next_step == Horde_Data::IMPORT_FILE) {
     $unique_dest = '';
     $dest_options = array();
     $hasWriteable = false;
-    foreach (Turba::getAddressBooks(PERMS_EDIT) as $key => $entry) {
+    foreach (Turba::getAddressBooks(Horde_Perms::EDIT) as $key => $entry) {
         $selected = ($key == $default_source) ? ' selected="selected"' : '';
         $dest_options[] = '<option value="' . htmlspecialchars($key) . '" ' . $selected . '>' .
             htmlspecialchars($entry['title']) . "</option>\n";
index 419356b..41fa481 100644 (file)
@@ -58,8 +58,8 @@ if (is_a($contact, 'PEAR_Error')) {
 }
 
 /* Check permissions on this contact. */
-if (!$contact->hasPermission(PERMS_EDIT)) {
-    if (!$contact->hasPermission(PERMS_READ)) {
+if (!$contact->hasPermission(Horde_Perms::EDIT)) {
+    if (!$contact->hasPermission(Horde_Perms::READ)) {
         $notification->push(_("You do not have permission to view this contact."), 'horde.error');
         header('Location: ' . Horde::applicationUrl($prefs->getValue('initial_page'), true));
         exit;
index 051ea5f..7c37bdf 100644 (file)
@@ -78,7 +78,7 @@ class Turba_Api extends Horde_Registry_Api
     {
         require_once dirname(__FILE__) . '/base.php';
 
-        $addressbooks = Turba::getAddressBooks($writeable ? PERMS_EDIT : PERMS_READ);
+        $addressbooks = Turba::getAddressBooks($writeable ? Horde_Perms::EDIT : Horde_Perms::READ);
         foreach ($addressbooks as $addressbook => $config) {
             $addressbooks[$addressbook] = $config['title'];
         }
@@ -251,7 +251,7 @@ class Turba_Api extends Horde_Registry_Api
                     return array();
                 }
                 $addressbooks = $GLOBALS['turba_shares']->listShares($parts[0],
-                    PERMS_READ,
+                    Horde_Perms::READ,
                     $parts[0]);
                 // The last check returns all addressbooks for the requested user,
                 // but that does not mean the requesting user has access to them.
@@ -621,7 +621,7 @@ class Turba_Api extends Horde_Registry_Api
             /* On new installations default_dir is not set, use first source
              * instead. */
             if (empty($import_source)) {
-                $import_source = key(Turba::getAddressBooks(PERMS_EDIT));
+                $import_source = key(Turba::getAddressBooks(Horde_Perms::EDIT));
             }
         }
 
@@ -637,7 +637,7 @@ class Turba_Api extends Horde_Registry_Api
             return PEAR::raiseError(sprintf(_("Connection failed: %s"), $driver->getMessage()), 'horde.error', null, null, $import_source);
         }
 
-        if (!$driver->hasPermission(PERMS_EDIT)) {
+        if (!$driver->hasPermission(Horde_Perms::EDIT)) {
             return PEAR::raiseError(_("Permission denied"), 'horde.error', null, null, $import_source);
         }
 
@@ -774,7 +774,7 @@ class Turba_Api extends Horde_Registry_Api
                 return PEAR::raiseError(sprintf(_("Connection failed: %s"), $driver->getMessage()), 'horde.error', null, null, $source);
             }
 
-            if (!$driver->hasPermission(PERMS_READ)) {
+            if (!$driver->hasPermission(Horde_Perms::READ)) {
                 continue;
             }
 
@@ -873,7 +873,7 @@ class Turba_Api extends Horde_Registry_Api
             return PEAR::raiseError(sprintf(_("Connection failed: %s"), $driver->getMessage()));
         }
 
-        if (!$driver->hasPermission(PERMS_READ)) {
+        if (!$driver->hasPermission(Horde_Perms::READ)) {
             return PEAR::raiseError(_("You don't have sufficient permissions to read the address book that contains your own contact."));
         }
 
@@ -943,7 +943,7 @@ class Turba_Api extends Horde_Registry_Api
                 return PEAR::raiseError(sprintf(_("Connection failed: %s"), $driver->getMessage()), 'horde.error', null, null, $source);
             }
 
-            if (!Horde_Auth::isAdmin() && !$driver->hasPermission(PERMS_DELETE)) {
+            if (!Horde_Auth::isAdmin() && !$driver->hasPermission(Horde_Perms::DELETE)) {
                 continue;
             }
 
@@ -1009,7 +1009,7 @@ class Turba_Api extends Horde_Registry_Api
             if (is_a($driver, 'PEAR_Error')) {
                 return PEAR::raiseError(sprintf(_("Connection failed: %s"), $driver->getMessage()), 'horde.error', null, null, $source);
             }
-            if (!$driver->hasPermission(PERMS_EDIT)) {
+            if (!$driver->hasPermission(Horde_Perms::EDIT)) {
                 continue;
             }
             $result = $driver->search(array('__uid' => $uid));
@@ -1595,7 +1595,7 @@ class Turba_Api extends Horde_Registry_Api
             return PEAR::raiseError(sprintf(_("Connection failed: %s"), $driver->getMessage()), 'horde.error', null, null, $source);
         }
 
-        if (!$driver->hasPermission(PERMS_EDIT)) {
+        if (!$driver->hasPermission(Horde_Perms::EDIT)) {
             return PEAR::raiseError(_("Permission denied"), 'horde.error', null, null, $source);
         }
 
@@ -1745,7 +1745,7 @@ class Turba_Api extends Horde_Registry_Api
                 if (is_a($driver, 'PEAR_Error')) {
                     continue;
                 }
-                if (!$driver->hasPermission(PERMS_EDIT)) {
+                if (!$driver->hasPermission(Horde_Perms::EDIT)) {
                     continue;
                 }
 
index ff0f9a5..894ad70 100644 (file)
@@ -155,7 +155,7 @@ class Turba_Application extends Horde_Registry_Application
         /* Only attempt share removal if we have shares configured */
         if (!empty($_SESSION['turba']['has_share'])) {
             $shares = &$GLOBALS['turba_shares']->listShares(
-                $user, PERMS_EDIT, $user);
+                $user, Horde_Perms::EDIT, $user);
 
             /* Look for the deleted user's default share and remove it */
             foreach ($shares as $share) {
index 662b60e..240fffe 100644 (file)
@@ -819,7 +819,7 @@ class Turba_Driver
             return $object;
         }
 
-        if (!$object->hasPermission(PERMS_DELETE)) {
+        if (!$object->hasPermission(Horde_Perms::DELETE)) {
             return PEAR::raiseError(_("Permission denied"));
         }
 
index 2f17883..16f1ca6 100644 (file)
@@ -35,8 +35,8 @@ class Turba_Driver_Facebook extends Turba_Driver
      function hasPermission($perm)
      {
          switch ($perm) {
-             case PERMS_EDIT: return false;
-             case PERMS_DELETE: return false;
+             case Horde_Perms::EDIT: return false;
+             case Horde_Perms::DELETE: return false;
              default: return true;
          }
      }
index 5c60e18..149aac6 100644 (file)
@@ -26,8 +26,8 @@ class Turba_Driver_Favourites extends Turba_Driver
      function hasPermission($perm)
      {
          switch ($perm) {
-             case PERMS_EDIT: return false;
-             case PERMS_DELETE: return false;
+             case Horde_Perms::EDIT: return false;
+             case Horde_Perms::DELETE: return false;
              default: return true;
          }
      }
index c070244..2a220f8 100644 (file)
@@ -39,8 +39,8 @@ class Turba_Driver_Group extends Turba_Driver
     function hasPermission($perm)
     {
         switch ($perm) {
-        case PERMS_EDIT:
-        case PERMS_DELETE:
+        case Horde_Perms::EDIT:
+        case Horde_Perms::DELETE:
             return false;
 
         default:
index c3a4894..b0bf04f 100644 (file)
@@ -606,16 +606,16 @@ class Turba_Driver_Imsp extends Turba_Driver
     {
         $hPerms = 0;
         if (strpos($acl, 'w') !== false) {
-            $hPerms |= PERMS_EDIT;
+            $hPerms |= Horde_Perms::EDIT;
         }
         if (strpos($acl, 'r') !== false) {
-            $hPerms |= PERMS_READ;
+            $hPerms |= Horde_Perms::READ;
         }
         if (strpos($acl, 'd') !== false) {
-            $hPerms |= PERMS_DELETE;
+            $hPerms |= Horde_Perms::DELETE;
         }
         if (strpos($acl, 'l') !== false) {
-            $hPerms |= PERMS_SHOW;
+            $hPerms |= Horde_Perms::SHOW;
         }
         return $hPerms;
     }
index 81bdb71..13ce734 100644 (file)
@@ -161,10 +161,10 @@ class Turba_ListView {
         $hasEdit = false;
         $hasExport = false;
         if (!is_a($driver, 'PEAR_Error')) {
-            if ($driver->hasPermission(PERMS_DELETE)) {
+            if ($driver->hasPermission(Horde_Perms::DELETE)) {
                 $hasDelete = true;
             }
-            if ($driver->hasPermission(PERMS_EDIT)) {
+            if ($driver->hasPermission(Horde_Perms::EDIT)) {
                 $hasEdit = true;
             }
             if ($GLOBALS['conf']['menu']['import_export']
index 1ae8b2b..fdc33d3 100644 (file)
@@ -204,7 +204,7 @@ class Turba_Object {
      */
     function isEditable()
     {
-        return $this->driver->hasPermission(PERMS_EDIT);
+        return $this->driver->hasPermission(Horde_Perms::EDIT);
     }
 
     /**
index c0254b0..d37dd47 100644 (file)
@@ -87,12 +87,12 @@ class Turba {
      * Get all the address books the user has the requested permissions to and
      * return them in the user's preferred order.
      *
-     * @param integer $permission  The PERMS_* constant to filter on.
+     * @param integer $permission  The Horde_Perms::* constant to filter on.
      * @param array $options       Any additional options.
      *
      * @return array  The filtered, ordered $cfgSources entries.
      */
-    function getAddressBooks($permission = PERMS_READ, $options = array())
+    function getAddressBooks($permission = Horde_Perms::READ, $options = array())
     {
         $addressbooks = array();
         foreach (array_keys(Turba::getAddressBookOrder()) as $addressbook) {
@@ -323,12 +323,13 @@ class Turba {
      *
      * @param array $in            The data we want filtered.
      * @param string $filter       What type of data we are filtering.
-     * @param integer $permission  The PERMS_* constant we will filter on.
+     * @param integer $permission  The Horde_Perms::* constant we will filter
+     *                             on.
      * @param array $options       Additional options.
      *
      * @return array  The filtered data.
      */
-    function permissionsFilter($in, $permission = PERMS_READ, $options = array())
+    function permissionsFilter($in, $permission = Horde_Perms::READ, $options = array())
     {
         $out = array();
 
@@ -501,7 +502,7 @@ class Turba {
      *
      * @return array  Shares the user has the requested permissions to.
      */
-    function listShares($owneronly = false, $permission = PERMS_READ)
+    function listShares($owneronly = false, $permission = Horde_Perms::READ)
     {
         if (empty($_SESSION['turba']['has_share'])) {
             // No backends are configured to provide shares
index da9a14f..0e8fa45 100644 (file)
@@ -35,7 +35,7 @@ class Turba_View_Contact {
     {
         global $conf, $prefs, $registry;
 
-        if (!$this->contact || is_a($this->contact, 'PEAR_Error') || !$this->contact->hasPermission(PERMS_READ)) {
+        if (!$this->contact || is_a($this->contact, 'PEAR_Error') || !$this->contact->hasPermission(Horde_Perms::READ)) {
             echo '<h3>' . _("The requested contact was not found.") . '</h3>';
             return;
         }
@@ -98,11 +98,11 @@ class Turba_View_Contact {
         echo '</div>';
 
         if ($active && $GLOBALS['browser']->hasFeature('dom')) {
-            if ($this->contact->hasPermission(PERMS_EDIT)) {
+            if ($this->contact->hasPermission(Horde_Perms::EDIT)) {
                 $edit = new Turba_View_EditContact($this->contact);
                 $edit->html(false);
             }
-            if ($this->contact->hasPermission(PERMS_DELETE)) {
+            if ($this->contact->hasPermission(Horde_Perms::DELETE)) {
                 $delete = new Turba_View_DeleteContact($this->contact);
                 $delete->html(false);
             }
index 749465d..7b5490a 100644 (file)
@@ -34,8 +34,8 @@ class Turba_View_DeleteContact {
             return;
         }
 
-        if (!$this->contact->hasPermission(PERMS_DELETE)) {
-            if (!$this->contact->hasPermission(PERMS_READ)) {
+        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 {
@@ -58,11 +58,11 @@ class Turba_View_DeleteContact {
 </div>
 <?php
         if ($active && $GLOBALS['browser']->hasFeature('dom')) {
-            if ($this->contact->hasPermission(PERMS_READ)) {
+            if ($this->contact->hasPermission(Horde_Perms::READ)) {
                 $view = new Turba_View_Contact($this->contact);
                 $view->html(false);
             }
-            if ($this->contact->hasPermission(PERMS_EDIT)) {
+            if ($this->contact->hasPermission(Horde_Perms::EDIT)) {
                 $delete = new Turba_View_EditContact($this->contact);
                 $delete->html(false);
             }
index 55d9c36..1c7da08 100644 (file)
@@ -37,8 +37,8 @@ class Turba_View_EditContact {
             return;
         }
 
-        if (!$this->contact->hasPermission(PERMS_EDIT)) {
-            if (!$this->contact->hasPermission(PERMS_READ)) {
+        if (!$this->contact->hasPermission(Horde_Perms::EDIT)) {
+            if (!$this->contact->hasPermission(Horde_Perms::READ)) {
                 echo '<h3>' . _("You do not have permission to view this contact.") . '</h3>';
                 return;
             } else {
@@ -53,11 +53,11 @@ class Turba_View_EditContact {
         echo '</div>';
 
         if ($active && $GLOBALS['browser']->hasFeature('dom')) {
-            if ($this->contact->hasPermission(PERMS_READ)) {
+            if ($this->contact->hasPermission(Horde_Perms::READ)) {
                 $view = new Turba_View_Contact($this->contact);
                 $view->html(false);
             }
-            if ($this->contact->hasPermission(PERMS_DELETE)) {
+            if ($this->contact->hasPermission(Horde_Perms::DELETE)) {
                 $delete = new Turba_View_DeleteContact($this->contact);
                 $delete->html(false);
             }
index 17677ba..d4df718 100644 (file)
@@ -85,7 +85,7 @@ $_SESSION['turba']['source'] = $default_source;
 
 // Only set $add_source_options if there is at least one editable address book
 // that is not the current address book.
-$addSources = Turba::getAddressBooks(PERMS_EDIT, array('require_add' => true));
+$addSources = Turba::getAddressBooks(Horde_Perms::EDIT, array('require_add' => true));
 $copymove_source_options = '';
 $copymoveSources = $addSources;
 unset($copymoveSources[$default_source]);
index e3cb548..ec79cd8 100755 (executable)
@@ -86,7 +86,7 @@ if (is_a($share, 'PEAR_Error')) {
 }
 $share->set('owner', $owner);
 $share->set('name', $title);
-$share->set('perm_default', PERMS_SHOW | PERMS_READ);
+$share->set('perm_default', Horde_Perms::SHOW | Horde_Perms::READ);
 $result = $turba_shares->addShare($share);
 if (is_a($result, 'PEAR_Error')) {
     var_dump($result);
index 2d65d88..5c24fbb 100644 (file)
@@ -30,7 +30,7 @@ if ($ob->hasValue('__key')) {
         . '</a>';
 
     $cell = Horde::link($ob->url()) . $link_text . '</a>';
-    if ($ob->hasPermission(PERMS_EDIT)) {
+    if ($ob->hasPermission(Horde_Perms::EDIT)) {
         $edit_url = Horde_Util::addParameter(
             'contact.php',
             array('view' => 'EditContact',
index fa190b4..26f356f 100644 (file)
@@ -31,7 +31,7 @@ if (is_a($object, 'PEAR_Error')) {
 }
 
 /* Check permissions on this contact. */
-if (!$object->hasPermission(PERMS_READ)) {
+if (!$object->hasPermission(Horde_Perms::READ)) {
     $notification->push(_("You do not have permission to view this object."), 'horde.error');
     header('Location: ' . Horde::applicationUrl($prefs->getValue('initial_page'), true));
     exit;
index 63bed7f..80e1e4d 100644 (file)
@@ -33,7 +33,7 @@ if (is_a($object, 'PEAR_Error')) {
 }
 
 /* Check permissions. */
-if (!$object->hasPermission(PERMS_READ)) {
+if (!$object->hasPermission(Horde_Perms::READ)) {
     throw new Horde_Exception(_("You do not have permission to view this contact."));
 }
 
index db4846e..676c0bd 100644 (file)
@@ -32,7 +32,7 @@ class Vilma {
         }
 
         if ($permmask === null) {
-            $permmask = PERMS_SHOW|PERMS_READ;
+            $permmask = Horde_Perms::SHOW|Horde_Perms::READ;
         }
 
         # Default deny all permissions