This is end of my seven week of Google Summer of Code 2012. Week before last week I started refactoring the Privileges sections. And there was a bug related to this section when my seven week started. After fixing this bug I created a lib file called server_privileges.lib.php in the library/ directory as I mentioned in last week report. This lib file is for function implementation of the Privileges section.
As a start I implemented a function for get a grants array PMA_getGrantsArray() .
Then there are functions to get the HTML for table specific privileges which I have implemented in server_privileges.lib.php
Under this, following functions have implemented
- PMA_getHtmlForTableSpecificPrivileges()
- PMA_getHtmlForAttachedPrivilegesToTableSpecificColumn()
- PMA_getHtmlForNotAttachedPrivilegesToTableSpecificColumn()
When I was implementing these functions I’ve involved some bug fixing on my previous refactoring on privileges section and also tbl_replace.php. But remaining bugs for tbl_replace.php still remaining for next week. These bugs are reported in Sourceforge also by myself.
And also PMA_getUsernameAndHostnameLength() function also have implemented in server_privileges.lib.php script.
After this I’ve implemented following functions for password update and privileges revoke.
- PMA_getMessageForUpdatePassword
- PMA_getMessageAndSqlQueryForPrivilegesRevoke
And also there is a function which is called PMA_getCommonSQlQueryForAddUserAndUpdatePrivs() for remove duplicate code in server_privileges.php which was implemented by myself.
For the next week I’ve complete the refactoring for Privileges section. For that server_privileges .php still contains unreadable code. I’ll implement separate functions for those code snippets. As an examples, separate functions for
- Updates privileges
- Delete users
- Add users
- Display the pages, etc.
After completing this section I’ll start implement some unit tests for tbl_changes.php script.
Pingback: Thilina Buddika Abeyrathna: Seventh week of GSOC | PHP World