Stéphane Jacob [Tue, 22 Mar 2011 14:28:54 +0000 (15:28 +0100)]
Fixes variable use.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Stéphane Jacob [Wed, 9 Mar 2011 08:42:49 +0000 (09:42 +0100)]
Fixes php notice.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Stéphane Jacob [Tue, 8 Mar 2011 08:41:35 +0000 (09:41 +0100)]
Removes forlifeEmailAlternate from core.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Stéphane Jacob [Sun, 6 Mar 2011 14:25:03 +0000 (15:25 +0100)]
Defines forlifeEmailAlternate function.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Stéphane Jacob [Tue, 1 Mar 2011 09:24:01 +0000 (10:24 +0100)]
Do not add empty job address in vcard.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Florent Bruneau [Sun, 27 Feb 2011 19:31:57 +0000 (20:31 +0100)]
Oops, missing file.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 27 Feb 2011 19:29:07 +0000 (20:29 +0100)]
Add a RSS handler for site_errors.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 27 Feb 2011 18:38:13 +0000 (19:38 +0100)]
Enabler PHP natives assertion in debug and use Platal::assert() as a
backend when assertions fail.
Thus, you can write the following code:
assert ('$toto != blah')
If you run in debug mode, this will be evaluated and will raise an
exception in case of error. If you run in production mode, this will juste
be skipped.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 27 Feb 2011 08:45:45 +0000 (09:45 +0100)]
Append xsrf_token if defined to API calls.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 26 Feb 2011 11:04:23 +0000 (12:04 +0100)]
Properly plug the error callback.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 25 Feb 2011 19:38:47 +0000 (20:38 +0100)]
Add jQuery.xapi(call, payload, successcb, errorcb) to call the API from
javascript.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 25 Feb 2011 16:26:10 +0000 (17:26 +0100)]
Use Env::set().
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 25 Feb 2011 16:24:11 +0000 (17:24 +0100)]
Post::set, Cookie::set and Get::set also update Env::
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 23 Feb 2011 19:29:49 +0000 (20:29 +0100)]
Allow 'make doc' in the core.
Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
Florent Bruneau [Wed, 16 Feb 2011 21:17:19 +0000 (22:17 +0100)]
Merge remote branch 'origin/core/1.1.2/maint' into core/master
Stéphane Jacob [Wed, 16 Feb 2011 14:17:16 +0000 (15:17 +0100)]
Fixes deprecated features in PHP 5.3.x.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Riton [Mon, 7 Feb 2011 18:25:41 +0000 (19:25 +0100)]
Typo Fix
Signed-off-by: Riton <riton@melix.net>
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Riton [Mon, 31 Jan 2011 15:02:19 +0000 (16:02 +0100)]
Allow overriding of PlSession::fillSession()
Signed-off-by: Riton <riton@melix.net>
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Raphaël Barrois [Sun, 30 Jan 2011 22:46:40 +0000 (23:46 +0100)]
Merge branch 'core/1.1.2/maint' into core/master
Raphaël Barrois [Tue, 25 Jan 2011 15:50:22 +0000 (16:50 +0100)]
Add 'set' and 'bootstrap' methods to Env/Get/Post
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Raphaël Barrois [Tue, 25 Jan 2011 15:50:22 +0000 (16:50 +0100)]
Add 'set' and 'bootstrap' methods to Env/Get/Post
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Florent Bruneau [Sun, 23 Jan 2011 19:58:24 +0000 (20:58 +0100)]
Cleanup JS (based on JSLint advices).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 23 Jan 2011 14:02:20 +0000 (15:02 +0100)]
No more js global variable platal_baseurl, use $.plURL() instead.
Also add usefull string functions (startsWith, endsWith, htmlEntities).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 22 Jan 2011 14:49:22 +0000 (15:49 +0100)]
Speed up platal engine.
Avoid useless recursions and function calls.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 21 Jan 2011 20:30:49 +0000 (21:30 +0100)]
Check html validity asynchronously.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 20 Jan 2011 20:49:47 +0000 (21:49 +0100)]
Coding rules.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Riton [Wed, 19 Jan 2011 23:48:08 +0000 (00:48 +0100)]
BugFix in PFC_OneChild (forgot a $this->)
Signed-off-by: Riton <riton@melix.net>
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 18 Jan 2011 20:38:19 +0000 (21:38 +0100)]
Add assertion API to jQuery.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Stéphane Jacob [Mon, 10 Jan 2011 15:33:53 +0000 (16:33 +0100)]
HTML validation.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Stéphane Jacob [Mon, 10 Jan 2011 13:21:17 +0000 (14:21 +0100)]
Fixes PlImage.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Florent Bruneau [Sat, 8 Jan 2011 19:57:44 +0000 (20:57 +0100)]
Create core.js with some utility functions from xorg.js.
This contains:
* some ajax wrappers
* dynPost
* miniwiki preview
* pmwiki obfuscation decoding
(Some functions were already called from the code of the core).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 8 Jan 2011 19:12:30 +0000 (20:12 +0100)]
Remove useless lines from gitignore.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 7 Jan 2011 20:13:01 +0000 (21:13 +0100)]
Fix end of lines.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 7 Jan 2011 20:12:13 +0000 (21:12 +0100)]
Simplify javascript.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Stéphane Jacob [Fri, 7 Jan 2011 14:43:57 +0000 (15:43 +0100)]
Removes calls to obsolete functions.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Florent Bruneau [Tue, 4 Jan 2011 20:52:37 +0000 (21:52 +0100)]
Happy New Year!
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Vincent Zanotti [Mon, 3 Jan 2011 18:57:53 +0000 (19:57 +0100)]
Adds a new PlApiHook for API handlers. The main two differences with
PlTokenHook is that (a) it provides stronger authentication, and (b) it
parses the JSON request payload before passing it to the handler.
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
Vincent Zanotti [Mon, 3 Jan 2011 16:51:31 +0000 (17:51 +0100)]
Creates a new plat/al error code for invalid request. This is intended
to be used for requests where the URL format, or the input is invalid
(for instance non JSON-encoded input for the API).
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
Vincent Zanotti [Sat, 1 Jan 2011 23:06:07 +0000 (00:06 +0100)]
Adds a new PlHook subclass for token-authenticated requests.
The new hook checks for either a valid token (in which case the
authentication level is assumed to always match), or a valid session (in
which case the auth level is checked against the session). Note that
this finally allows token-based handlers to be permission checked.
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
Stéphane Jacob [Tue, 28 Dec 2010 19:33:20 +0000 (20:33 +0100)]
Merge branch 'core/maint' into core/master
Stéphane Jacob [Tue, 28 Dec 2010 14:46:00 +0000 (15:46 +0100)]
Allows deletion based on 2 fields in plTableEditor.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Stéphane Jacob [Mon, 20 Dec 2010 20:39:39 +0000 (21:39 +0100)]
Retrieves ids from a PlSet.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Florent Bruneau [Thu, 16 Dec 2010 20:13:55 +0000 (21:13 +0100)]
Merge remote branch 'origin/core/1.1.1/maint' into core/master
Florent Bruneau [Thu, 16 Dec 2010 20:02:34 +0000 (21:02 +0100)]
Fix check.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 15 Dec 2010 13:29:38 +0000 (14:29 +0100)]
Fix invalid error detection.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Wed, 15 Dec 2010 12:43:41 +0000 (13:43 +0100)]
In case of RPC error, show the HTTP answer.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 12 Dec 2010 20:49:06 +0000 (21:49 +0100)]
Produce errors in case of RPC failures.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 9 Dec 2010 21:54:16 +0000 (22:54 +0100)]
Remove debugging stuff.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 9 Dec 2010 21:22:37 +0000 (22:22 +0100)]
Add an embedded mode for platal.
You can query /embedded/{mode}/path/to/url to get a mode in which the
skinning mode information is propagated through pages.
e.g.: https://www.p.org/embedded/light/search can be used to get the
search page with light skinning.
Note: This only requires a hack in .htaccess to work with static files.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 27 Nov 2010 21:01:38 +0000 (22:01 +0100)]
PlImage supports timestamps.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 14 Nov 2010 16:27:36 +0000 (17:27 +0100)]
Allow insertion of a batch of entries.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 14 Nov 2010 16:27:14 +0000 (17:27 +0100)]
Ensure PlBacktrace is loaded before registering errors.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 13 Nov 2010 21:00:19 +0000 (22:00 +0100)]
Fix permission check for page edition.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 6 Nov 2010 11:42:46 +0000 (12:42 +0100)]
Take into account PlExportable interface.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 6 Nov 2010 10:59:16 +0000 (11:59 +0100)]
Coding rules.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 6 Nov 2010 07:53:43 +0000 (08:53 +0100)]
Add an helper to build the export of the PFOs.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Riton [Fri, 5 Nov 2010 21:48:08 +0000 (22:48 +0100)]
Removed unconsistent reference passing in PlFilter
Instances are already passed by reference in PHP. Adding & only obfuscates the
code and make PHP throw notices.
Signed-off-by: Riton <riton@melix.net>
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 5 Nov 2010 21:04:39 +0000 (22:04 +0100)]
PlFilterOrder is an abstract class, put a default implementation for
export() there.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 5 Nov 2010 20:50:42 +0000 (21:50 +0100)]
PlFlagset and PlDBTableEntry are exportable.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Riton [Fri, 5 Nov 2010 20:39:48 +0000 (21:39 +0100)]
Added interface PlExportable and implemented it on PlFilter, PlFilterCondition and PlFilterOrder
Classes which implement PlExportable must expose an export() method.
It should return an associative array representing the instance.
Signed-off-by: Riton <riton@melix.net>
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 1 Nov 2010 20:06:29 +0000 (21:06 +0100)]
PlDBTableEntry: add support for field validators.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Stéphane Jacob [Thu, 4 Nov 2010 11:34:33 +0000 (12:34 +0100)]
Do not show old errors when clearing them.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Stéphane Jacob [Thu, 4 Nov 2010 11:33:48 +0000 (12:33 +0100)]
Prevents error when displaying site errors.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Florent Bruneau [Mon, 1 Nov 2010 15:05:28 +0000 (16:05 +0100)]
Fix some php errors.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 1 Nov 2010 14:54:40 +0000 (15:54 +0100)]
Several improvements on how PHP errors are managed.
Use PlBacktrace to handle PHP error instead of $GLOBAL['pl_errors']. When
output is in json add a special key with the traces. When site is in debug
mode, errors are automatically dumped by PlBacktrace. When site is in
production mode, use the legacy pl_print_errors to print the errors at the
bottom on the page.
This commit also introduce a new solution to build json handlers: if the
handler return PL_JSON, then the site will produce json from the variables
previously assigned vi jsonAssign.
Note: Don't use jsonDisplay() for the new json output because
jsonDisplay() output contains user-controlled content (I mean, content
passed by the user through Post, Get or Cookie) and this is not a good
idea: the site should never output something it does not fully control.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 1 Nov 2010 11:18:19 +0000 (12:18 +0100)]
Clear cache link in menu also clear PlCache.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 1 Nov 2010 11:17:52 +0000 (12:17 +0100)]
Add PlCache::clear{Variant}() and PlCache::clearAll().
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 1 Nov 2010 10:50:56 +0000 (11:50 +0100)]
PlDBTableEntry: can provide a custom formatter to serialize/unserialize
the value of a field.
Also provide a JSon formatter.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 1 Nov 2010 10:50:33 +0000 (11:50 +0100)]
Add can_convert_to_integer and to_integer functions.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 31 Oct 2010 21:29:45 +0000 (22:29 +0100)]
PlDBTableEntry: add support for custom selection.
Selection based on a non-primary key is now possible.
$user = new PlDBTableEntry('accounts');
$user->uid = 26071;
$user->fetch(); /* selection on primary key */
$user = new PlDBTableEntry('accounts');
$user->hruid = 'florent.bruneau.2003';
$user->fetch(); /* selection on non-primary unique key */
This also works for multiple keys in case of iteration
$selector = new PlDBTableEntry('accounts');
$selector->type = 'ax';
foreach ($selector as $user) {
$user->comment = 'AX secretary';
$user->update();
}
PlDBTableEntry now expose iterateOnCondition that takes a custom condition
for the entry selection.
$selector = new PlDBTableEntry('accounts');
$it = $selector->iterateOnCondition('FIND_IN_SET(\'watch\', flags');
while ($user = $it->next()) {
$user->comment = 'Watched account';
$user->update();
}
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 31 Oct 2010 20:11:41 +0000 (21:11 +0100)]
PlDBTableEntry: add support for date(time) fields, insertion and deletion.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 28 Oct 2010 21:12:35 +0000 (23:12 +0200)]
Security...
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 28 Oct 2010 21:03:51 +0000 (23:03 +0200)]
Should avoid fatal errors when sending emails from the website...
(including automatic emails).
Don't know how we didn't notice this one before.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 26 Oct 2010 15:20:01 +0000 (17:20 +0200)]
Release core 1.1.1
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Raphaël Barrois [Tue, 19 Oct 2010 21:18:00 +0000 (23:18 +0200)]
Fix select_db_table to handle properly 'valeur=0' commands
empty() is an evil PHP function:
empty($a['x']) is true if $a['x'] == 0...
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Florent Bruneau [Thu, 14 Oct 2010 15:40:36 +0000 (17:40 +0200)]
Add a new class that aims at providing a simple gateway between stored
data and php code when data are fetched 'as is'.
UseCase: classes like Phones or Addresses.
How to use:
/* Fetching the content of a entry */
$entry = new PlDBTableEntry('accounts', true /* autofetch */);
$entry->uid = 26071;
print $entry->hruid;
/* Iterating on entries and saving changes*/
$selector = new PlDBTableEntry('profile_phones');
$selector->pid = 26071;
$selector->link_type = 'pro';
foreach ($selector as $entry) {
$entry->comment = 'Professional phone number';
$entry->save();
}
Note: ATM, SQL joins are not supported, but this is planned for the
future with an API that might looks like:
$entry = new PlDBTableEntry(array($mainTable,
PlSqlJoin::left(),
PlSqlJoin::inner()));
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sat, 16 Oct 2010 20:44:06 +0000 (22:44 +0200)]
Add an API to handle caching.
In most cases, the API usages is the following:
$var = PlCache::get{Variant}('key',
'factory',
array('factoryarg1','factoryarg2', ...));
PlCache::invalidate{Variant}, set{Variant} and has{Variant} are also
provided.
The Variant provides hints on the expiration of the data and whether it
can be shared between users/sessions or not. Available variants are:
- Local = no sharing, invalidate data after the execution of the page
- Session = no sharing, invalidate data when the session dies
- Global = sharable, can invalidate data after a timeout
Examples:
function buildDataFromDb($tableName)
{
return do_something_very_expensive($tableName);
}
/* Example using all-in-one 'get' variant' */
$value = PlCache::getSession('blah_' . $tableName',
'buildDataFromDb',
array($tableName),
1 /* ensure the value is not
computed more than once
per second */
);
/* Same example using has, set and get */
if (!PlCache::hasSession('blah_' . $tableName)) {
$value = buildDataFromDb($tableName);
PlCache::setSession('blah_' . $tableName, $value, 1);
} else {
$value = PlCache::getSession('blah_' . $tableName);
}
Note: this second example can in very specific conditions produce invalid
results if hasSession is called before expiration of the data and
getSession after.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Stéphane Jacob [Fri, 15 Oct 2010 12:52:41 +0000 (14:52 +0200)]
Returns transaction result.
Signed-off-by: Stéphane Jacob <sj@m4x.org>
Florent Bruneau [Tue, 12 Oct 2010 13:12:27 +0000 (15:12 +0200)]
Improves site_errors.
The new version include the context of the error and is easily extensible.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 12 Oct 2010 09:47:07 +0000 (11:47 +0200)]
Use explicit click on the trace to toggle its visibility.
Kill the long standing "Hover me pour la trace". This was pretty cool a
few years ago, but it tends not to work as well as it used to do with
modern browsers.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 11 Oct 2010 15:12:21 +0000 (17:12 +0200)]
Update ChangeLog
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 11 Oct 2010 14:59:36 +0000 (16:59 +0200)]
Add a guard against overlapping transactions.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 10 Oct 2010 09:23:38 +0000 (11:23 +0200)]
Fix deprecated references to XorgDBIterator (renamed to XDBIterator).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 7 Oct 2010 12:21:33 +0000 (14:21 +0200)]
Add XDB::runTransaction($callback, $arg1, $arg2, $arg2...) to run a
callback as a SQL transaction with automatic commit/rollback in case of
success/failure.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Thu, 7 Oct 2010 11:54:05 +0000 (13:54 +0200)]
Add XDB::startTransaction(), XDB::commit() and XDB::rollback().
Note: you should always use these functions when using transactions since
they perform the necessary post/pre actions to ensure the environment is
well configured.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 5 Oct 2010 20:36:11 +0000 (22:36 +0200)]
Fix SUID.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Sun, 3 Oct 2010 16:14:48 +0000 (18:14 +0200)]
Add unit tests for soundex.
The goal of this tests is to provide an improved version of the soundex
algorithm in the future.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 1 Oct 2010 14:31:08 +0000 (16:31 +0200)]
Don't be so lazy, implements all the XDB::raw* variants.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 1 Oct 2010 14:21:53 +0000 (16:21 +0200)]
Use XDB::raw variants.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 1 Oct 2010 14:17:01 +0000 (16:17 +0200)]
Add XDB::rawXXXX($query) that runs the given query without formatting.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Fri, 1 Oct 2010 11:43:51 +0000 (13:43 +0200)]
TableEditor: don't use REPLACE to update the content of a row.
REPLACE deletes the row and then insert the new value. If the content of
the row is used as a foreign key by another table, this leads to a full
cleanup of all the entries that point to the deleted row... and when you
update the 'x' account_type, this removes all the accounts.
This also fix some minor programming errors:
* let XDB perform the escaping, don't use addslashes manually.
* don't call XDB('machin = {?} AND ' . $someStringContainingUserInput, $myvalue)
(this is not critical since the placeholder is before the
'random' string, but this can lead to errors if the 'random' string
contain a placeholder {?}).
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 28 Sep 2010 12:58:07 +0000 (14:58 +0200)]
Add PlUser::isMe($other): returns true if $other is a reference to the
same user.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 28 Sep 2010 12:37:33 +0000 (14:37 +0200)]
Use user object from session to compute permission when using 'hasPerm' in
templates.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 28 Sep 2010 09:16:08 +0000 (11:16 +0200)]
PlFlagSet is iterable.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 28 Sep 2010 09:04:14 +0000 (11:04 +0200)]
Add interface PlIteraface and the corresponding abstract class
PlAbstractIterable.
PlIterable aims at providing a common interface for the objects that can
produce a PlIterator. It extends PHP's IteratorAggregate that provides an
interface for producing a PHP's iterator.
PlAbstractIterable provides a default implementation for
IteratorAggregate::getIterator.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 28 Sep 2010 08:18:29 +0000 (10:18 +0200)]
Add tests for XDBFormat.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Tue, 28 Sep 2010 08:11:52 +0000 (10:11 +0200)]
Add PlIteratorUtils::foreachIterator() to build a PHP's Iterator from a
PlIterator.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 27 Sep 2010 08:26:10 +0000 (10:26 +0200)]
Directly invoke XDB::prepare() instead of using __autoload + call_user_func_array.
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Florent Bruneau [Mon, 27 Sep 2010 08:22:20 +0000 (10:22 +0200)]
Big cleanup of XDB.
* get rid of these annoying _ in member and method names
* introduces XDBFormat interface in order to allow objects to provide
their own formatting when used as a query argument.
* s/XorgDB/XDB/
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
Riton [Fri, 24 Sep 2010 19:12:47 +0000 (21:12 +0200)]
Extracted PlSqlJoin out of PlFilter class file
Signed-off-by: Riton <henri.jouhaud@polytechnique.org>
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>