Ferby's Blog
These are just some random ramblings, because I have nothing better to do with my time.

Monday, June 30, 2008

RN - Permissions Refactor

By John, Annie, Lucy and the Woof-Woofs at 1:48 PM

I refactored permissions again. This will really only affect developers and users shouldn't notice a difference. In common.php permissions are set by $permissions = new Permissions(); And now calls to get permissions look like this: $permission->isAdmin(true); Where the boolean passed it determines if the user should be booted if they don't have the permission. If you pass in false the function will return a boolean telling if the user has the permission. To check for multiple permissions on a page call $permissions->checkForPermissions(array('admin_group_add', 'admin_group_edit', 'admin_group_delete')); This function will boot the user if they don't have one of the permissions defined.

I have refactored the permissions page and the group pages to use this new system. Right now all other admin pages check for $permissions->isAdmin(true);

 
Category:

Wednesday, June 25, 2008

RN - Calendar

By John, Annie, Lucy and the Woof-Woofs at 2:00 PM

Fixed a bug and added a feature to the calendar.

The bug I fixed is that my compare function to compare the calendar date to the raid date was comparing the raid date it gmt time so depending on time zone of the server some of the raids were displaying in the wrong dates.

The feature I added is that the calendar now displays the raids in the user's set time zone. So if the server is in pst and the raid is schedule for 11pm, but the user is in est then the raid will display in the next day of the calendar for that user.

Next up is to set a user preference to switch the raids to display in the user's timezone or the raid's timezone.

 
Category:

Tuesday, June 24, 2008

RN - Rss

By John, Annie, Lucy and the Woof-Woofs at 3:32 PM

I added an rss.php page that will output the visible raids into an rss feed. This will display the raids in the server's time. We can't use the user's time, since this file is accessed without a login session. I haven't done any extensive testing yet, and I need to get all of the useful information for the raid into the feed (right now it only displays the raid name, date and notes).

 
Category:

Wednesday, June 18, 2008

Raid Ninja Calendar

By John, Annie, Lucy and the Woof-Woofs at 4:20 PM

Thanks to Jon I was able to copy most of the code for a calendar view. All I had to do was modify it to fit in RN's templating system, and that wasn't hard. Right now all it does is display the current month. I gave it a basic style in the rn2.css file and I added a link to the nav bar for it.

Raid Ninja Calendar
 
Category:

Tuesday, June 17, 2008

Raid Ninja Permissions

By John, Annie, Lucy and the Woof-Woofs at 2:54 PM

I wanted to expand on the permissions in Raid Ninja a bit more. Over the last week I created a page to allow admins the ability to edit user permissions. The page displays a list of links that are the user names. Click the link and the page will display a list of checkboxes for the various permissions. Those permissions that the user has are checked. The admins can then (un)check permissions as they see fit.

Now previously RN used an adminCheck page to see if the user was allow into the admin pages and if not it booted them to the main index. In order to set up Raid Ninja to use this new permission system I had to create a helper function, checkForPermission($permissionName), which will check if the current user has the permission and if not it will boot them to the main screen. So I replaced all instances of the include('adminCheck'.$phpEx); line that I could find with checkForPermission('is_admin'); All seems well. This checkForPermission() function will check for the permission passed in and the 'is_admin' permission. Since if a user is an admin they will have access to anything regardless of other permissions.

If you want to check if a user has a certain permission, but don't want to boot them. Like say you want to display a button for adding groups, but not if the user only has permission to edit them. $checkPermission($permissionName) will return a boolean if the user has this permission.

I have to talk to Nate to about where to put these checks for other permissions, but once I have an idea I'll be updating the other admin pages with the specific permissions that are needed.

I haven't quite decided on my next project for RN, but I'm thinking I might take a look into the calendar view.

 
Category:

Monday, June 16, 2008

Updates

By John, Annie, Lucy and the Woof-Woofs at 11:34 AM

Implemented the permissions editing for users in Raid Ninja, and added the attendance table to the stats page. Then for my rpg I implemented inn keepers took about 10 minutes.

Oh yeah and I got married on the 7th.

 
Category: ,