summaryrefslogtreecommitdiff
path: root/src/lib
AgeCommit message (Collapse)Author
2011-10-27I think this fixes everything, but it now depends on PHP 5.3+Luke Shumaker
The introduction of the dependency on PHP 5.3 is that lib/Singleton.class uses `get_called_class()'
2011-10-23Refactor to *finally* get rid of the god-class "MessageManager".Luke Shumaker
Accomplish this largely by using singletons. Now, I know this breaks the "build", at least in PHP 5.2. But there's a lot here that's good stuff, so just wait for the next commit. Now, a *LOT* changed, as you can see by the size of the diff; it's about a day and a half of editing worth of editing. I'll describe a little of it, but I'm not going to go into a ton of detail, and won't bother trying to break it into separate commits (they're all so interconnected, it would be mental masturbation). 'Cause I'm the only one looking at it at this point. 1. MessageManager did 3 things: A. Act as a global site class. This has been moved into `lib/Site.class.php' B. Act as a registry for singletons. Now there's a `lib/Singleton.class.php' abstract class to let them manage themselves. : Note: With the possible exception of Database, none of the : : singletons *need* to be singletons, but to create : : multiple of them would be wasteful. : C. Check if the database conf file exists, and if it doesn't show an error message. This has been moved into index.php, and the message has been turned into a proper view. 2. Recognize `Auth.class.php' for what it is, a multiton. Rename Auth::getObj to Auth::getInstance to be consistant with singletons. 3. Make Site->baseUrl() (formerly `MessageManager->baseUrl()') figure the base URL each time, either with or without the database. This way we can be more flexible with initing the Template. 4. Init Template (now a singleton) sanely. We can now use views with no DB. I will use the above to shorten the below file changes: index.php: [1C] Also, just tidy up. src/controllers/Users.class.php: [1B] [2] src/lib/Controller.class.php: [4] src/lib/DB.class.php: [1B] [2] src/lib/Database.class.php: [1B] src/lib/Hasher.class.php: [1B] (new file) A singleton wrapper around `ext/PasswordHash.class.php', use bcrypt while exposing fewer internals. src/lib/Login.class.php: [1B] src/lib/MessageManager.class.php: [1] src/lib/Model.class.php: [1B] (new file) A abstract class for models, so they don't have to worry about initing the DB. src/lib/PluginManager.class.php: [1B] src/lib/Singleton.class.php: [1B] (new file) An abstract class that will take care of being a singleton for you; in order to make a class a singleton, just extend Singleton. src/lib/Site.class.php: [1A] [3] (new file) src/lib/View.class.php: [4] src/models/Auth.class.php: [2] [1B] Also make getUsername safely return false if the DB isn't connected. src/models/ContactMethod: extend `Model' src/views/Template.class.php: [1B] [3] src/views/pages/no-conf.html.php: [1C] src/views/pages/plugins/index.html.php: [1B] src/views/pages/users/500.html.php: [1B]
2011-10-09Merge branch 'master' into concurrent-editingLuke Shumaker
So, here's the deal: * The meat of [concurrent-editing]:Form.class got merged into [master]:DB.class * The string-generation stuff in [concurrent-editing]:Form.class didn't fit nicely anywhere anymore, so I got rid of it by makeing datatype explicit. * Users.class: declare datatypes explicitly in attrib() * index.html.php: use this new explicit data * style.scss: add a .small, which we can do because of the datatypes thing. Conflicts: src/controllers/Users.class.php
2011-10-09Move Users->[gs]etConf into a new DB.class.php, add in some wrappers for ↵Luke Shumaker
equivalent stuff with plugin and system config.
2011-10-04Begin work on safely allowing concurrent edits on data, giving better form ↵Luke Shumaker
interface.
2011-10-04Add a trailing newline to Database.class.phpLuke Shumaker
2011-09-25don't allow deleted users to log in. (They'd get permission denied on ↵Luke Shumaker
everything, but they could log in)
2011-09-22Implement ReCaptcha entirely as a plugin, remove all of the uglinessLuke Shumaker
from my old implementation.
2011-09-22Implement actual plugin management. I was tired of doing the SQL queries by ↵Luke Shumaker
hand :)
2011-09-22Misc. cleanup: improve comments in Login, add description to SenderIdenticaLuke Shumaker
2011-09-22Fix a terrible, terrible bug in Database.class.php, I was calling ↵Luke Shumaker
getSysConf() without this "$this->" in front of it.
2011-09-19Add a decent fallback for when both file extension and Accept methods of ↵Luke Shumaker
selecting the view fail (as they do in IE6-8)
2011-09-05Fix 3 bugs (stray * in SQL, typo in variable name, a place where ↵Luke Shumaker
isLoggedIn() was still being called on the DB
2011-09-05Fix a nasty bug in View.class.php when the installation path contains a dotmckenzierobotics.org
2011-09-05Fix a few growing painsLuke Shumaker
* Users.class.php: whitespace change, fix a few array things * Database.class.php: refer to $mm->hasher(), not $this->hasher() * new.html.php: fix stupid shit
2011-09-05Refactor a bitLuke Shumaker
* move a lot of stuff out of MessageManager * move models from lib to models
2011-09-04Screw it, I'm tired of trying to break this into individual commitsLuke Shumaker
2011-09-04Fix bug in MessageManager->sanitizeArray()Luke Shumaker
2011-09-04start to add a plugin management frameworkLuke Shumaker
2011-09-04New router and view selector engine magic coolness.Luke Shumaker
2011-08-01initial commit.Luke Shumaker
Partway through a rewrite. I have some old files I didn't want to entirely delete.