On Wednesday 29 November 2006 1:58 pm, Alexander Nicolaysen Sørnes wrote:
New and improved version.
Regards,
Alexander N. Sørnes
Looks a lot better.
+ // Allow user to apply as super maintainer if this is a new app + if(!$this->iAppId or $this->iAppId == "/") + { + if($this->bSuperMaintainerRequest)
Why are you comparing the iAppId against a string containing a forward slash?
+ /* Approve automatically if submitted by an admin */ + if($_SESSION['current']->AppCreatedMustBeQueued()) + $this->sQueued = 'true'; + else + $this->sQueued = 'false'; +
We probably want to make a new interface function here like MaintainerCreatedMustBeQueued() so we don't overload the meaning of this function. Today we aren't very particular about user roles but adding user roles is something we should do and keeping these privilages finely grained is useful.
Also, the unit tests don't pass after this change. I suspect something related to the queueing changes:
test_user_update_password() starting test_user_update_password() passed test_maintainer_getMaintainerCountForUser() starting test_maintainer_getMaintainerCountForUser() passed test_maintainer_getAppsMaintained() starting aAppsMaintained is null, we expected a non-null return value!<------------- test_maintainer_getAppsMaintained() failed!
test_query_parameters() starting test_query_parameters() passed
You can run these by going into the appdb/unit_test/ directory and executing ./run_tests from the command line. Make sure you don't have sendmail configured or you may end up sending emails around. We should really disable emailing at the start of the unit tests...
Chris