Merge lp:~quam-plures-core/quam-plures/qp5_final_branch into lp:quam-plures

Proposed by EdB
Status: Merged
Merged at revision: 7663
Proposed branch: lp:~quam-plures-core/quam-plures/qp5_final_branch
Merge into: lp:quam-plures
Diff against target: 2497 lines (+864/-454)
44 files modified
admin.php (+3/-3)
blog2.php (+0/-42)
blog3.php (+0/-42)
blog4.php (+0/-42)
qp_config/_admin.php (+72/-7)
qp_inc/_application.php (+3/-3)
qp_inc/_core/__core.init.php (+25/-48)
qp_inc/_core/_param.funcs.php (+5/-0)
qp_inc/_core/model/__core.install.php (+2/-32)
qp_inc/_core/ui/results/_results.class.php (+12/-6)
qp_inc/blogs/blogs.ctrl.php (+1/-1)
qp_inc/blogs/model/_blog.class.php (+3/-3)
qp_inc/files/file_settings.ctrl.php (+48/-16)
qp_inc/files/files.ctrl.php (+2/-2)
qp_inc/files/model/_file.class.php (+3/-0)
qp_inc/files/model/_file.funcs.php (+5/-4)
qp_inc/files/model/_filelist.class.php (+5/-2)
qp_inc/files/model/_fileroot.class.php (+3/-3)
qp_inc/files/model/_filerootcache.class.php (+1/-1)
qp_inc/files/upload.ctrl.php (+124/-42)
qp_inc/files/views/_file_browse.view.php (+2/-2)
qp_inc/files/views/_file_browse_set.form.php (+1/-1)
qp_inc/files/views/_file_list.inc.php (+1/-1)
qp_inc/files/views/_file_settings.form.php (+32/-59)
qp_inc/generic/model/_genericelement.class.php (+1/-1)
qp_inc/generic/views/_generic_category.form.php (+1/-1)
qp_inc/plugins/_plugin.class.php (+11/-0)
qp_inc/plugins/_plugin.funcs.php (+2/-1)
qp_inc/plugins/model/_plugins_admin.class.php (+1/-0)
qp_inc/sessions/_sessions.init.php (+3/-6)
qp_inc/settings/model/_generalsettings.class.php (+9/-1)
qp_inc/templates/model/_template.class.php (+3/-0)
qp_inc/tools/views/_system_list.view.php (+2/-20)
qp_inc/users/model/_user.class.php (+28/-7)
qp_inc/users/model/_user.funcs.php (+37/-12)
qp_inc/users/model/_usersettings.class.php (+1/-1)
qp_inc/users/users.ctrl.php (+11/-0)
qp_inc/users/views/_user.form.php (+46/-20)
qp_inc/users/views/_user_list.view.php (+37/-10)
qp_install/_create_items.php (+9/-9)
qp_install/_functions_dbupgrade.php (+297/-0)
qp_plugins/smilies_plugin/_smilies.plugin.php (+6/-1)
qp_srvc/profile_update.php (+4/-1)
qp_srvc/register.php (+2/-1)
To merge this branch: bzr merge lp:~quam-plures-core/quam-plures/qp5_final_branch
Reviewer Review Type Date Requested Status
Quam Plures Core Team Pending
Review via email: mp+156414@code.launchpad.net

Description of the change

the last of the "monster" series. after this we're back to business as usual :)

To post a comment you must log in.
7667. By EdB

more stuff ... not sure what but it fixes problems

7668. By EdB

updating release date to today

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'admin.php'
2--- admin.php 2013-03-18 19:20:42 +0000
3+++ admin.php 2013-04-18 18:37:26 +0000
4@@ -79,10 +79,10 @@
5 if( ! $admin_template || ! file_exists( sprintf( $admin_template_path, $admin_template ) ) )
6 {
7 // even the default template does not exist!
8- // set 'wind' as the admin template if it exists
9- if( file_exists( sprintf( $admin_template_path, 'wind' ) ) )
10+ // set 'earth' as the admin template if it exists
11+ if( file_exists( sprintf( $admin_template_path, 'earth' ) ) )
12 {
13- $admin_template = 'wind';
14+ $admin_template = 'earth';
15 }
16 else
17 {
18
19=== removed file 'blog2.php'
20--- blog2.php 2013-03-08 20:58:52 +0000
21+++ blog2.php 1970-01-01 00:00:00 +0000
22@@ -1,42 +0,0 @@
23-<?php
24-/**
25- * Stub File Template
26- *
27- * This file is used to create a new stub file when a blog is created. If the value of $blog
28- * is not NNN then this file was created; only stubfile.template.php has that value of $blog.
29- *
30- * @author {@link http://wonderwinds.com/ Ed Bennett}
31- * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project}
32- * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
33- * @package templates
34- */
35-
36-// select which blog
37-$blog = 2;
38-
39-// retricts posts to published, hides drafts
40-$show_statuses = array();
41-
42-// ignore before, unix timestamp or 'now'
43-$timestamp_min = '';
44-
45-// ignore after, unix timestamp or 'now'
46-$timestamp_max = 'now';
47-
48-// force a template?
49-# $template = 'custom';
50-
51-// change order?
52-# $order = 'ASC';
53-
54-/**
55- * Load the configuration minimum
56- */
57-require_once dirname(__FILE__).'/qp_config/_config.php';
58-
59-/**
60- * Main initialization, with the identified $blog
61- */
62-require $inc_path.'_blog_main.inc.php';
63-
64-?>
65
66=== removed file 'blog3.php'
67--- blog3.php 2013-03-08 20:58:52 +0000
68+++ blog3.php 1970-01-01 00:00:00 +0000
69@@ -1,42 +0,0 @@
70-<?php
71-/**
72- * Stub File Template
73- *
74- * This file is used to create a new stub file when a blog is created. If the value of $blog
75- * is not NNN then this file was created; only stubfile.template.php has that value of $blog.
76- *
77- * @author {@link http://wonderwinds.com/ Ed Bennett}
78- * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project}
79- * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
80- * @package templates
81- */
82-
83-// select which blog
84-$blog = 3;
85-
86-// retricts posts to published, hides drafts
87-$show_statuses = array();
88-
89-// ignore before, unix timestamp or 'now'
90-$timestamp_min = '';
91-
92-// ignore after, unix timestamp or 'now'
93-$timestamp_max = 'now';
94-
95-// force a template?
96-# $template = 'custom';
97-
98-// change order?
99-# $order = 'ASC';
100-
101-/**
102- * Load the configuration minimum
103- */
104-require_once dirname(__FILE__).'/qp_config/_config.php';
105-
106-/**
107- * Main initialization, with the identified $blog
108- */
109-require $inc_path.'_blog_main.inc.php';
110-
111-?>
112
113=== removed file 'blog4.php'
114--- blog4.php 2013-03-08 20:58:52 +0000
115+++ blog4.php 1970-01-01 00:00:00 +0000
116@@ -1,42 +0,0 @@
117-<?php
118-/**
119- * Stub File Template
120- *
121- * This file is used to create a new stub file when a blog is created. If the value of $blog
122- * is not NNN then this file was created; only stubfile.template.php has that value of $blog.
123- *
124- * @author {@link http://wonderwinds.com/ Ed Bennett}
125- * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project}
126- * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
127- * @package templates
128- */
129-
130-// select which blog
131-$blog = 4;
132-
133-// retricts posts to published, hides drafts
134-$show_statuses = array();
135-
136-// ignore before, unix timestamp or 'now'
137-$timestamp_min = '';
138-
139-// ignore after, unix timestamp or 'now'
140-$timestamp_max = 'now';
141-
142-// force a template?
143-# $template = 'custom';
144-
145-// change order?
146-# $order = 'ASC';
147-
148-/**
149- * Load the configuration minimum
150- */
151-require_once dirname(__FILE__).'/qp_config/_config.php';
152-
153-/**
154- * Main initialization, with the identified $blog
155- */
156-require $inc_path.'_blog_main.inc.php';
157-
158-?>
159
160=== modified file 'qp_config/_admin.php'
161--- qp_config/_admin.php 2013-03-22 21:28:25 +0000
162+++ qp_config/_admin.php 2013-04-18 18:37:26 +0000
163@@ -24,6 +24,8 @@
164 * - 2 if you want to be able to cross-post among multiple blogs/categories
165 * - 3 if you want to be able to change main cat among blogs
166 * Note: #3 moves the posts from one blog to another, so use with caution.
167+ *
168+ * @global integer $allow_cross_posting
169 */
170 $allow_cross_posting = 1;
171
172@@ -32,6 +34,8 @@
173 *
174 * Automatically balance unmatched tags in posts and comments. Choose
175 * the formatting options for your posts: 0 to disable, 1 to enable
176+ *
177+ * @global bool $balance_tags
178 */
179 $balance_tags = 1;
180
181@@ -40,30 +44,38 @@
182 *
183 * Default of 1 messages sent via the message form will be checked against
184 * the antispam blacklist. Set it to 0 if you like spam I guess.
185+ *
186+ * @global bool $antispam_on_message_form
187 */
188 $antispam_on_message_form = 1;
189
190 /**
191+ * Cookie Expired
192+ *
193+ * Expired-time, used to erase comment meta data cookies. Default is 24 hours ago.
194+ *
195+ * @global integer $cookie_expired
196+ */
197+$cookie_expired = time() - 86400;
198+
199+/**
200 * Cookies Expire
201 *
202 * Expiration for comment meta data cookies, in seconds. Set this to 0 if you wish
203 * to use non-permanent cookies (erased when browser is closed). Default is one
204 * year from now.
205+ *
206+ * @global integer $cookie_expires
207 */
208 $cookie_expires = time() + 31536000;
209
210 /**
211- * Cookie Expired
212- *
213- * Expired-time, used to erase comment meta data cookies. Default is 24 hours ago.
214- */
215-$cookie_expired = time() - 86400;
216-
217-/**
218 * Cron Timeout Delay
219 *
220 * Seconds after which a scheduled task is considered to be timed out, default is
221 * 30 minutes.
222+ *
223+ * @global integer $cron_timeout_delay
224 */
225 $cron_timeout_delay = 1800;
226
227@@ -72,6 +84,8 @@
228 *
229 * This controls how many items by section (comments, drafts, recent edits)
230 * are displayed on the dashboard page.
231+ *
232+ * @global integer $dash_disp_num
233 */
234 $dash_disp_num = 5;
235
236@@ -83,6 +97,8 @@
237 * - 1 = yes
238 * - 2 = yes and potentially die() to display debug info (needed before redirects,
239 * e-g message_send.php)
240+ *
241+ * @global integer $debug
242 */
243 $debug = 0;
244
245@@ -92,6 +108,8 @@
246 * Display elements that are different on each request (Page processing time, ...)
247 * Set this to true to prevent displaying minor changing elements (like time) in
248 * order not to have artificial content changes.
249+ *
250+ * @global bool $debug_obhandler
251 */
252 $debug_obhandler = false;
253
254@@ -101,6 +119,8 @@
255 * $debug always applies to anyone logged in. Set this to 1 if you want debug info
256 * displayed when you are not logged in (for troubleshooting what a visitor sees).
257 * Default is 0. possible values: 0 = no, 1 = yes
258+ *
259+ * @global bool $debug_visitors
260 */
261 $debug_visitors = 0;
262
263@@ -108,6 +128,8 @@
264 * XMLRPC logging
265 *
266 * Set this to 1 to log XMLRPC calls received by this server (into /qp_srvc/xmlrpc.log).
267+ *
268+ * @global bool $debug_xmlrpc_logging
269 */
270 $debug_xmlrpc_logging = 0;
271
272@@ -118,6 +140,8 @@
273 * do not allow changes to the 'admin' or 'demouser' or 'demoblogger' or 'demospecial'
274 * accounts/groups, blog media directories can only be configured to be inside of
275 * {@link $media_path}.
276+ *
277+ * @global bool $demo_mode
278 */
279 $demo_mode = false;
280
281@@ -126,6 +150,8 @@
282 *
283 * File extensions that the admin will not be able to enable via the admin interface
284 * (Global settings => files).
285+ *
286+ * @global array $forbidden_upload_exts
287 */
288 $forbidden_upload_exts = array(
289 'cgi',
290@@ -148,6 +174,8 @@
291 * The admin can configure the regular expression for valid file names in the Settings
292 * interface. However if this is set to non empty, the admin will not be able to
293 * customize these values.
294+ *
295+ * @global string $force_regexp_filename
296 */
297 $force_regexp_filename = '';
298
299@@ -157,6 +185,8 @@
300 * The admin can configure the regular expression for valid dir names in the Settings
301 * interface. However if this is set to non empty, the admin will not be able to
302 * customize these values.
303+ *
304+ * @global string $force_regexp_dirname
305 */
306 $force_regexp_dirname = '';
307
308@@ -166,6 +196,8 @@
309 * The "home" button on the top right of the navbar is the only use of this. By
310 * default this is the base url, and unless you do a complex installation there
311 * is no need to change it.
312+ *
313+ * @global string $home_url
314 */
315 $home_url = $app_baseurl;
316
317@@ -182,15 +214,32 @@
318 *
319 * @todo generate a random instance name at install and have it saved in the global
320 * params in the DB
321+ *
322+ * @global string $instance_name
323 */
324 $instance_name = 'quamplures';
325
326 /**
327+ * Lock user's ID and nickname
328+ *
329+ * Setting this to 'true' will mean a user can not change their login ID or nickname.
330+ * They will still be able to change their "known as" - just not their nickname
331+ * or login :) Useful if you need continuity over time for all your users (for example
332+ * when this app is the gateway to a forum or chatroom or other 3rd party with a
333+ * login requirement).
334+ *
335+ * @global bool $lock_id_and_nick
336+ */
337+$lock_id_and_nick = false;
338+
339+/**
340 * Minimum Comment Interval
341 *
342 * This is the minimum interval in seconds between consecutive comments from the
343 * same IP. Increasing this can slow down spam attacks, and piss off real visitors
344 * if too high.
345+ *
346+ * @global integer $minimum_comment_interval
347 */
348 $minimum_comment_interval = 30;
349
350@@ -202,6 +251,8 @@
351 *
352 * This is legacy code that needs to be reverse-engineered, completely figured out,
353 * and either fixed or killed. As-is this is crap - EdB.
354+ *
355+ * @global array $posttypes_locked_IDs
356 */
357 $posttypes_locked_IDs = array( 1000, 1500, 1520, 1530, 1570, 2000 );
358
359@@ -214,6 +265,8 @@
360 *
361 * This is legacy code that needs to be reverse-engineered, completely figured out,
362 * and either fixed or killed. As-is this is crap - EdB.
363+ *
364+ * @global array $posttypes_reserved_IDs
365 */
366 $posttypes_reserved_IDs = array( 3000, 4000, 5000 );
367
368@@ -225,6 +278,8 @@
369 * and getfile.php will check the User permisssion to view files. HOWEVER this will
370 * not prevent users from hitting directly into the media folder with their web
371 * browser. You still need to restrict access to the media folder from your webserver.
372+ *
373+ * @global bool $public_access_to_media
374 */
375 $public_access_to_media = true;
376
377@@ -234,6 +289,8 @@
378 * Default of 1 means a comment can not be left without the commenter providing
379 * a name and email address. Set this to 0 to allow anonymous comments (without
380 * name & email address).
381+ *
382+ * @global bool $require_name_email
383 */
384 $require_name_email = 1;
385
386@@ -242,6 +299,8 @@
387 *
388 * Admins can configure max file upload size, but they won't be able to set it higher
389 * than this "max max" value.
390+ *
391+ * @global integer $upload_maxmaxkb
392 */
393 $upload_maxmaxkb = 10000;
394
395@@ -263,6 +322,8 @@
396 * tag URL "marker", you won't be able to access either the post or the tag page,
397 * depending on the value of this setting. And no, that doesn't make sense to me
398 * either :/
399+ *
400+ * @global bool $tags_dash_fix
401 */
402 $tags_dash_fix = 0;
403
404@@ -270,6 +331,8 @@
405 * XHTML use Strict
406 *
407 * Set this to true if you want to enforce XHTML strict validation
408+ *
409+ * @global bool $xhtml_use_strict
410 */
411 $xhtml_use_strict = false;
412
413@@ -277,6 +340,8 @@
414 * XHTML validate comments
415 *
416 * Do we want to use XHTML validation for comments?
417+ *
418+ * @global bool $xhtml_validate_comments
419 */
420 $xhtml_validate_comments = true;
421
422
423=== modified file 'qp_inc/_application.php'
424--- qp_inc/_application.php 2013-03-22 21:28:25 +0000
425+++ qp_inc/_application.php 2013-04-18 18:37:26 +0000
426@@ -19,16 +19,16 @@
427 $app_homepage = 'http://quamplures.net/';
428
429 // The fileset version: incremented at whatever rate feels good :)
430-$files_version = '1.20';
431+$files_version = '1.50';
432
433 // The database version, incrememented by 1 with each change in upgrade_dbase_tables()
434-$app_db_version = 43;
435+$app_db_version = 70;
436
437 // This way the version tells us the files and the database :)
438 $app_version = $files_version.'.'.$app_db_version;
439
440 // The application's release date (ISO) for major (quarterly) releases
441-$app_date = '2013-03-21';
442+$app_date = '2013-04-18';
443
444 // Displayed on the login screen
445 $app_banner = '<a href="'.$app_homepage.'"><img src="'.$rsc_url.'logo.jpg" width="337" height="76" alt="'.$app_name.'" /></a>';
446
447=== modified file 'qp_inc/_core/__core.init.php'
448--- qp_inc/_core/__core.init.php 2013-03-22 21:28:25 +0000
449+++ qp_inc/_core/__core.init.php 2013-04-18 18:37:26 +0000
450@@ -29,64 +29,42 @@
451 $app_db_config['aliases'] = array(
452 'T_antispam' => $app_db_tableprefix.'antispam',
453 'T_blogs' => $app_db_tableprefix.'blogs',
454- 'T_blog_groups' => $app_db_tableprefix.'bloggroups',
455- 'T_blog_settings' => $app_db_tableprefix.'coll_settings',
456- 'T_blog_users' => $app_db_tableprefix.'blogusers',
457+ 'T_blog_groups' => $app_db_tableprefix.'blog_groups',
458+ 'T_blog_settings' => $app_db_tableprefix.'blog_settings',
459+ 'T_blog_users' => $app_db_tableprefix.'blog_users',
460 'T_categories' => $app_db_tableprefix.'categories',
461 'T_collections' => $app_db_tableprefix.'collections',
462 'T_comments' => $app_db_tableprefix.'comments',
463- 'T_cron_log' => $app_db_tableprefix.'cron__log',
464- 'T_cron_task' => $app_db_tableprefix.'cron__task',
465+ 'T_cron_log' => $app_db_tableprefix.'cron_log',
466+ 'T_cron_task' => $app_db_tableprefix.'cron_task',
467 'T_files' => $app_db_tableprefix.'files',
468 'T_filetypes' => $app_db_tableprefix.'filetypes',
469 'T_groups' => $app_db_tableprefix.'groups',
470- 'T_items' => $app_db_tableprefix.'items__item',
471- 'T_item_cats' => $app_db_tableprefix.'postcats',
472+ 'T_items' => $app_db_tableprefix.'items',
473+ 'T_item_cats' => $app_db_tableprefix.'item_cats',
474 'T_item_colls' => $app_db_tableprefix.'item_colls',
475- 'T_item_prerendering' => $app_db_tableprefix.'items__prerendering',
476- 'T_item_status' => $app_db_tableprefix.'items__status',
477- 'T_item_tags' => $app_db_tableprefix.'items__itemtag',
478- 'T_item_types' => $app_db_tableprefix.'items__type',
479- 'T_item_versions' => $app_db_tableprefix.'items__version',
480+ 'T_item_prerendering' => $app_db_tableprefix.'item_prerendering',
481+ 'T_item_status' => $app_db_tableprefix.'item_status',
482+ 'T_item_tags' => $app_db_tableprefix.'item_tags',
483+ 'T_item_types' => $app_db_tableprefix.'item_types',
484+ 'T_item_versions' => $app_db_tableprefix.'item_versions',
485 'T_links' => $app_db_tableprefix.'links',
486 'T_locales' => $app_db_tableprefix.'locales',
487 'T_plugins' => $app_db_tableprefix.'plugins',
488- 'T_plugin_events' => $app_db_tableprefix.'pluginevents',
489- 'T_plugin_settings' => $app_db_tableprefix.'pluginsettings',
490- 'T_plugin_usersettings' => $app_db_tableprefix.'pluginusersettings',
491+ 'T_plugin_events' => $app_db_tableprefix.'plugin_events',
492+ 'T_plugin_settings' => $app_db_tableprefix.'plugin_settings',
493+ 'T_plugin_usersettings' => $app_db_tableprefix.'plugin_usersettings',
494 'T_settings' => $app_db_tableprefix.'settings',
495 'T_subscriptions' => $app_db_tableprefix.'subscriptions',
496- 'T_tags' => $app_db_tableprefix.'items__tag',
497- 'T_templates' => $app_db_tableprefix.'templates__template',
498- 'T_template_containers' => $app_db_tableprefix.'templates__container',
499+ 'T_tags' => $app_db_tableprefix.'tags',
500+ 'T_templates' => $app_db_tableprefix.'templates',
501+ 'T_template_containers' => $app_db_tableprefix.'template_containers',
502 'T_users' => $app_db_tableprefix.'users',
503 'T_user_cyberspace' => $app_db_tableprefix.'user_cyberspace',
504 'T_user_realworld' => $app_db_tableprefix.'user_realworld',
505- 'T_plugin_sharedfields' => $app_db_tableprefix.'plugin_sharedfields',
506- 'T_plugin_sharedvalues' => $app_db_tableprefix.'plugin_sharedvalues',
507- 'T_user_settings' => $app_db_tableprefix.'usersettings',
508- 'T_widgets' => $app_db_tableprefix.'widget',
509- 'T_coll_group_perms' => $app_db_tableprefix.'bloggroups', // old, going away
510- 'T_coll_settings' => $app_db_tableprefix.'coll_settings', // old, going away
511- 'T_coll_user_perms' => $app_db_tableprefix.'blogusers', // old, going away
512- 'T_cron__log' => $app_db_tableprefix.'cron__log', // old, going away
513- 'T_cron__task' => $app_db_tableprefix.'cron__task', // old, going away
514- 'T_items__item' => $app_db_tableprefix.'items__item', // old, going away
515- 'T_postcats' => $app_db_tableprefix.'postcats', // old, going away
516- 'T_items__prerendering' => $app_db_tableprefix.'items__prerendering', // old, going away
517- 'T_items__status' => $app_db_tableprefix.'items__status', // old, going away
518- 'T_items__itemtag' => $app_db_tableprefix.'items__itemtag', // old, going away
519- 'T_items__type' => $app_db_tableprefix.'items__type', // old, going away
520- 'T_items__version' => $app_db_tableprefix.'items__version', // old, going away
521- 'T_pluginevents' => $app_db_tableprefix.'pluginevents', // old, going away
522- 'T_pluginsettings' => $app_db_tableprefix.'pluginsettings', // old, going away
523- 'T_pluginusersettings' => $app_db_tableprefix.'pluginusersettings', // old, going away
524- 'T_items__tag' => $app_db_tableprefix.'items__tag', // old, going away
525- 'T_templates__template' => $app_db_tableprefix.'templates__template', // old, going away
526- 'T_templates__container' => $app_db_tableprefix.'templates__container', // old, going away
527- 'T_usersettings' => $app_db_tableprefix.'usersettings', // old, going away
528- 'T_widget' => $app_db_tableprefix.'widget', // old, going away
529- );
530+ 'T_user_settings' => $app_db_tableprefix.'user_settings',
531+ 'T_widgets' => $app_db_tableprefix.'widgets',
532+);
533
534 // Controller mappings
535 $ctrl_mappings = array(
536@@ -452,7 +430,7 @@
537 // we have blog files
538 $entries['file_manager']['entries']['fm_view_blog'] = array(
539 'text' => T_('View BLOG Files').'&hellip;',
540- 'href' => $admin_url.'?ctrl=files&amp;root=collection_'.$blog_id,
541+ 'href' => $admin_url.'?ctrl=files&amp;root=blog_'.$blog_id,
542 );
543 if( empty( $Blog ) )
544 {
545@@ -498,7 +476,7 @@
546 // we have blog files
547 $entries['file_manager']['entries']['fm_add_blog'] = array(
548 'text' => T_('Upload BLOG Files').'&hellip;',
549- 'href' => $admin_url.'?ctrl=upload&amp;root=collection_'.$blog_id,
550+ 'href' => $admin_url.'?ctrl=upload&amp;root=blog_'.$blog_id,
551 );
552 if( empty( $Blog ) )
553 {
554@@ -683,7 +661,7 @@
555 // current user's profile
556 $entries['userprefs']['entries']['userprof'] = array(
557 'text' => T_('Your Profile').'&hellip;',
558- 'href' => get_user_profile_url(),
559+ 'href' => get_user_profile_url( $current_User->ID ),
560 );
561
562 if( $current_User->check_perm( 'users', 'edit' ) )
563@@ -765,13 +743,12 @@
564 ),
565 );
566
567-
568 if( ! $current_User->check_perm( 'admin', 'visible' ) )
569 {
570 // user can not access admin, replace admin link with profile link
571 $entries['abswitch']['text'] = '<strong>'.$current_User->login.'</strong>';
572 $entries['abswitch']['title'] = T_('Edit your user profile');
573- $entries['abswitch']['href'] = get_user_profile_url();
574+ $entries['abswitch']['href'] = get_user_profile_url( $current_User->ID );
575 $entries['abswitch']['class'] = '';
576
577 if( $subs_url = get_user_subs_url() )
578
579=== modified file 'qp_inc/_core/_param.funcs.php'
580--- qp_inc/_core/_param.funcs.php 2013-03-23 18:54:25 +0000
581+++ qp_inc/_core/_param.funcs.php 2013-04-18 18:37:26 +0000
582@@ -387,6 +387,10 @@
583 */
584 function param_check_number( $var, $err_msg, $required = false )
585 {
586+ // first get the param even as a string to avoid red-death errors
587+ param( $var, 'string', $required ? true : '' );
588+
589+ // if it is empty and that's okay then we're done? wait it might be a string ... which might be okay anyway
590 if( empty( $GLOBALS[$var] ) && ! $required )
591 {
592 // empty is OK
593@@ -395,6 +399,7 @@
594
595 if( ! preg_match( '#^[0-9]+$#', $GLOBALS[$var] ) )
596 {
597+ // forget_param( 'link_ID' );
598 param_error( $var, $err_msg );
599 return false;
600 }
601
602=== modified file 'qp_inc/_core/model/__core.install.php'
603--- qp_inc/_core/model/__core.install.php 2013-03-22 21:28:25 +0000
604+++ qp_inc/_core/model/__core.install.php 2013-04-18 18:37:26 +0000
605@@ -55,7 +55,7 @@
606 blog_tagline VARCHAR(250) NULL default '',
607 blog_description VARCHAR(250) NULL default '',
608 blog_longdesc TEXT NULL DEFAULT NULL,
609- blog_locale VARCHAR(20) NOT NULL DEFAULT 'en-EU',
610+ blog_locale VARCHAR(20) NOT NULL DEFAULT 'en-US',
611 blog_access_type VARCHAR(10) NOT NULL DEFAULT 'index.php',
612 blog_siteurl VARCHAR(120) NOT NULL default '',
613 blog_urlname VARCHAR(255) NOT NULL DEFAULT 'urlname',
614@@ -202,7 +202,7 @@
615 'T_files' => array( 'Creating files table',
616 "CREATE TABLE T_files (
617 file_ID INT(11) unsigned not null AUTO_INCREMENT,
618- file_root_type ENUM('absolute','user','collection','shared','templates') not null default 'absolute',
619+ file_root_type ENUM('absolute','user','blog','shared','templates') not null default 'absolute',
620 file_root_ID INT(11) unsigned not null default 0,
621 file_path VARCHAR(255) not null default '',
622 file_title VARCHAR(255),
623@@ -565,36 +565,6 @@
624 UNIQUE wi_order( wi_widget_blog_ID, wi_sco_name, wi_order )
625 ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ),
626
627- /**
628- * This table holds info about fields a plugin might want to access and
629- * use. The only time it gets called is on a plugin's settings page
630- * for the various bits that make a plugin field be a plugin field
631- */
632- 'T_plugin_sharedfields' => array( 'Creating table for User field definitions',
633- "CREATE TABLE T_plugin_sharedfields (
634- psf_fieldname VARCHAR(16) NOT NULL,
635- psf_label VARCHAR(255) NOT NULL,
636- psf_type VARCHAR(255) NOT NULL, -- probably only 'text', maybe 'checkbox', 'select' is crazy talk!
637- psf_note VARCHAR(255) NOT NULL,
638- psf_validate VARCHAR(255) NOT NULL, -- make sure a url is a url ... for example
639- PRIMARY KEY ( psf_fieldname )
640- ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ),
641-
642- /**
643- * This table holds user-specific info for any shared plugin field. When on a
644- * plugin's settings page it gets accessed to find then store info about a
645- * user. The plugin then stores the fact that some info about the user
646- * is stored in this table for the rest of QP to do it's thing with.
647- */
648- 'T_plugin_sharedvalues' => array( 'Creating table for User fields',
649- "CREATE TABLE T_plugin_sharedvalues (
650- psv_ID INT(10) unsigned NOT NULL auto_increment,
651- psv_user_ID INT(10) unsigned NOT NULL,
652- psv_psf_fieldname VARCHAR(32) NOT NULL,
653- psv_userfieldvalue VARCHAR(255) NOT NULL,
654- PRIMARY KEY ( psv_ID )
655- ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ),
656-
657 );
658
659 ?>
660
661=== modified file 'qp_inc/_core/ui/results/_results.class.php'
662--- qp_inc/_core/ui/results/_results.class.php 2013-03-22 21:28:25 +0000
663+++ qp_inc/_core/ui/results/_results.class.php 2013-04-18 18:37:26 +0000
664@@ -92,9 +92,13 @@
665 */
666 var $current_Obj;
667 /**
668- * Definitions for each column:
669+ * Definitions for each column
670+ *
671+ * Possible definitions for each column are:
672 * - th
673+ * - th_class
674 * - td
675+ * - td_class
676 * - order: SQL column name(s) to sort by (delimited by comma)
677 * - order_objects_callback: a PHP callback function (can be array( $Object, $method )).
678 * This gets three params: $a, $b, $desc. $a and $b are instantiated objects
679@@ -104,8 +108,7 @@
680 * This gets three params: $a, $b, $desc. $a and $b are DB row objects, $desc
681 * is either 'ASC' or 'DESC'. The function has to return -1, 0 or 1, according
682 * to if the $a < $b, $a == $b or $a > $b.
683- * - td_class
684- * @var foo
685+ * @var array something goes here
686 */
687 var $cols;
688 /**
689@@ -191,11 +194,14 @@
690 * Constructor
691 *
692 * @param string SQL query
693- * @param string prefix to differentiate page/order params when multiple Results appear one same page
694- * @param string default ordering of columns (special syntax) if not specified in the URL params
695+ * @param string prefix to differentiate page/order params when multiple Results
696+ * appear one same page
697+ * @param string default ordering of columns (special syntax) if not specified
698+ * in the URL params
699 * - example: -A-- will sort in ascending order on 2nd column
700 * - example: ---D will sort in descending order on 4th column
701- * @param integer number of lines displayed on one page (0 to disable paging; null to use $UserSettings/results_per_page)
702+ * @param integer number of lines displayed on one page (0 to disable paging;
703+ * null to use $UserSettings/results_per_page)
704 * @param string SQL to get the total count of results
705 * @param boolean
706 * @param string|integer SQL query used to count the total # of rows
707
708=== modified file 'qp_inc/blogs/blogs.ctrl.php'
709--- qp_inc/blogs/blogs.ctrl.php 2013-03-12 06:26:03 +0000
710+++ qp_inc/blogs/blogs.ctrl.php 2013-04-18 18:37:26 +0000
711@@ -86,7 +86,7 @@
712 {
713 // okay good, continue
714 $file_imploded = implode( '', $file_loaded );
715- $stub_filename = 'blog'.$edited_Blog->urlname.'.php';
716+ $stub_filename = $edited_Blog->urlname.'.php';
717 $new_file = $basepath.$stub_filename;
718 $f = @fopen( $new_file, 'w' );
719 if( $f == false )
720
721=== modified file 'qp_inc/blogs/model/_blog.class.php'
722--- qp_inc/blogs/model/_blog.class.php 2013-03-12 21:17:25 +0000
723+++ qp_inc/blogs/model/_blog.class.php 2013-04-18 18:37:26 +0000
724@@ -1089,7 +1089,7 @@
725 {
726 global $dispatcher;
727
728- return $dispatcher.'?ctrl=files&amp;root='.FileRoot::gen_ID( 'collection', $this->ID );
729+ return $dispatcher.'?ctrl=files&amp;root='.FileRoot::gen_ID( 'blog', $this->ID );
730 }
731
732
733@@ -1133,7 +1133,7 @@
734
735 if( ! $Settings->get( 'fm_enable_roots_blog' ) )
736 {
737- // User directories are disabled
738+ // blog directories are disabled
739 return false;
740 }
741
742@@ -1208,7 +1208,7 @@
743
744 if( ! $Settings->get( 'fm_enable_roots_blog' ) )
745 {
746- // User directories are disabled
747+ // blog directories are disabled
748 return false;
749 }
750
751
752=== modified file 'qp_inc/files/file_settings.ctrl.php'
753--- qp_inc/files/file_settings.ctrl.php 2013-03-22 21:28:25 +0000
754+++ qp_inc/files/file_settings.ctrl.php 2013-04-18 18:37:26 +0000
755@@ -29,9 +29,17 @@
756 {
757 $Settings->delete_array( array(
758 'fm_enable_roots_blog',
759+ 'fm_blog_limit_files',
760+ 'fm_blog_limit_bytes',
761 'fm_enable_roots_user',
762+ 'fm_user_limit_files',
763+ 'fm_user_limit_bytes',
764 'fm_enable_roots_shared',
765+ 'fm_shared_limit_files',
766+ 'fm_shared_limit_bytes',
767 'fm_enable_roots_templates',
768+ 'fm_templates_limit_files',
769+ 'fm_templates_limit_bytes',
770 'fm_enable_create_dir',
771 'fm_default_chmod_dir',
772 'fm_enable_create_file',
773@@ -51,18 +59,48 @@
774 }
775 else
776 {
777- // Filemanager settings
778+ // "Accessible file roots" settings
779+ // ... blog folders
780 param( 'fm_enable_roots_blog', 'integer', 0 );
781 $Settings->set( 'fm_enable_roots_blog', $fm_enable_roots_blog );
782+ param_check_number( 'fm_blog_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'blog' ) );
783+ $Settings->set( 'fm_blog_limit_files', $fm_blog_limit_files );
784+ param_check_number( 'fm_blog_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'blog' ) );
785+ $Settings->set( 'fm_blog_limit_bytes', $fm_blog_limit_bytes );
786+ // ... user folders
787 param( 'fm_enable_roots_user', 'integer', 0 );
788 $Settings->set( 'fm_enable_roots_user', $fm_enable_roots_user );
789+ param_check_number( 'fm_user_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'user' ) );
790+ $Settings->set( 'fm_user_limit_files', $fm_user_limit_files );
791+ param_check_number( 'fm_user_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'user' ) );
792+ $Settings->set( 'fm_user_limit_bytes', $fm_user_limit_bytes );
793+ // ... shared folders
794 param( 'fm_enable_roots_shared', 'integer', 0 );
795 $Settings->set( 'fm_enable_roots_shared', $fm_enable_roots_shared );
796+ param_check_number( 'fm_shared_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'shared' ) );
797+ $Settings->set( 'fm_shared_limit_files', $fm_shared_limit_files );
798+ param_check_number( 'fm_shared_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'shared' ) );
799+ $Settings->set( 'fm_shared_limit_bytes', $fm_shared_limit_bytes );
800+ // ... template folders
801 param( 'fm_enable_roots_templates', 'integer', 0 );
802 $Settings->set( 'fm_enable_roots_templates', $fm_enable_roots_templates );
803+ param_check_number( 'fm_templates_limit_files', sprintf( T_('"%s file limit" must be numbers only'), 'template' ) );
804+ $Settings->set( 'fm_templates_limit_files', $fm_templates_limit_files );
805+ param_check_number( 'fm_templates_limit_bytes', sprintf( T_('"%s dir size" must be numbers only'), 'template' ) );
806+ $Settings->set( 'fm_templates_limit_bytes', $fm_templates_limit_bytes );
807+
808+ // "File creation options" settings
809 param( 'fm_enable_create_dir', 'integer', 0 );
810 $Settings->set( 'fm_enable_create_dir', $fm_enable_create_dir );
811- // Default dir CHMOD
812+ param( 'fm_enable_create_file', 'integer', 0 );
813+ $Settings->set( 'fm_enable_create_file', $fm_enable_create_file );
814+ param( 'upload_enabled', 'integer', 0 );
815+ $Settings->set( 'upload_enabled', $upload_enabled );
816+ param_integer_range( 'upload_maxkb', 1, $upload_maxmaxkb, T_('Maximum allowed filesize must be between %d and %d KB.') );
817+ $Settings->set( 'upload_maxkb', $upload_maxkb ); // upload limit
818+
819+ // "File creation options" settings
820+ // ... default dir CHMOD
821 if( param( 'fm_default_chmod_dir', 'string', NULL ) !== NULL )
822 {
823 if( ! preg_match('~^[0-7]{3}$~', $fm_default_chmod_dir) )
824@@ -71,9 +109,7 @@
825 }
826 $Settings->set( 'fm_default_chmod_dir', $fm_default_chmod_dir );
827 }
828- param( 'fm_enable_create_file', 'integer', 0 );
829- $Settings->set( 'fm_enable_create_file', $fm_enable_create_file );
830- // Default files CHMOD
831+ // ... default files CHMOD
832 if( param( 'fm_default_chmod_file', 'string', NULL ) !== NULL )
833 {
834 if( ! preg_match('~^[0-7]{3}$~', $fm_default_chmod_file) )
835@@ -82,23 +118,19 @@
836 }
837 $Settings->set( 'fm_default_chmod_file', $fm_default_chmod_file );
838 }
839- // Upload
840- param( 'upload_enabled', 'integer', 0 );
841- $Settings->set( 'upload_enabled', $upload_enabled );
842- param_integer_range( 'upload_maxkb', 1, $upload_maxmaxkb, T_('Maximum allowed filesize must be between %d and %d KB.') );
843- $Settings->set( 'upload_maxkb', $upload_maxkb );
844- // Advanced settings
845+ // ... valid folder and file name
846+ param( 'regexp_dirname', 'string', '' );
847+ if( param_check_isregexp( 'regexp_dirname', T_('Valid dirname pattern is not a regular expression!') ) )
848+ {
849+ $Settings->set( 'regexp_dirname', $regexp_dirname );
850+ }
851 param( 'regexp_filename', 'string', '' );
852 if( param_check_isregexp( 'regexp_filename', T_('Valid filename pattern is not a regular expression!') ) )
853 {
854 $Settings->set( 'regexp_filename', $regexp_filename );
855 }
856- param( 'regexp_dirname', 'string', '' );
857- if( param_check_isregexp( 'regexp_dirname', T_('Valid dirname pattern is not a regular expression!') ) )
858- {
859- $Settings->set( 'regexp_dirname', $regexp_dirname );
860- }
861
862+ // wrap it up, ship it out
863 if( ! $Messages->count('error') )
864 {
865 if( $Settings->dbupdate() )
866
867=== modified file 'qp_inc/files/files.ctrl.php'
868--- qp_inc/files/files.ctrl.php 2013-03-22 21:28:25 +0000
869+++ qp_inc/files/files.ctrl.php 2013-04-18 18:37:26 +0000
870@@ -190,7 +190,7 @@
871 if( empty( $fm_FileRoot ) && ! empty( $Blog ) )
872 {
873 // Still not set a root, try to get it for the current Blog
874- $fm_FileRoot = & $FileRootCache->get_by_type_and_ID( 'collection', $Blog->ID );
875+ $fm_FileRoot = & $FileRootCache->get_by_type_and_ID( 'blog', $Blog->ID );
876 if( ! $fm_FileRoot || ! isset( $available_Roots[$fm_FileRoot->ID] ) )
877 {
878 // Root not found or not in list of available ones
879@@ -775,7 +775,7 @@
880
881 // fp> TODO: this block should move to a general level
882 // Try to go to the right blog:
883- if( $fm_Filelist->get_root_type() == 'collection' )
884+ if( $fm_Filelist->get_root_type() == 'blog' )
885 {
886 set_working_blog( $fm_Filelist->get_root_ID() );
887 // Load the blog we're in
888
889=== modified file 'qp_inc/files/model/_file.class.php'
890--- qp_inc/files/model/_file.class.php 2013-03-22 21:28:25 +0000
891+++ qp_inc/files/model/_file.class.php 2013-04-18 18:37:26 +0000
892@@ -1646,6 +1646,9 @@
893
894 /**
895 * Generate the IMG THUMBNAIL tag with all the alt & title if available
896+ *
897+ * @todo (3086) EdB> this needs to be params instead of ordered bits
898+ * @todo (3086) EdB> this really needs params/bits for setting alt and title
899 */
900 function get_thumb_imgtag( $size_name = 'fit-80x80', $class = '', $align = '' )
901 {
902
903=== modified file 'qp_inc/files/model/_file.funcs.php'
904--- qp_inc/files/model/_file.funcs.php 2013-03-22 21:28:25 +0000
905+++ qp_inc/files/model/_file.funcs.php 2013-04-18 18:37:26 +0000
906@@ -151,6 +151,7 @@
907 *
908 * This checks if there's a _adminUI.class.php in there.
909 *
910+ * @todo (3086) EdB> this is ignoring the setting for default admin template :(
911 * @return array List of directory names that hold admin templates or false, if
912 * the admin templates directory does not exist.
913 */
914@@ -181,14 +182,14 @@
915 }
916 // lets alphabetize them
917 sort( $r );
918- // if we have "wind" put it first so we default to that
919- if( in_array( 'wind', $r ) )
920+ // if we have "earth" put it first so we default to that
921+ if( in_array( 'earth', $r ) )
922 {
923 $r_clone = array();
924- $r_clone[] = 'wind';
925+ $r_clone[] = 'earth';
926 foreach( $r as $v )
927 {
928- if( $v != 'wind' )
929+ if( $v != 'earth' )
930 {
931 $r_clone[] = $v;
932 }
933
934=== modified file 'qp_inc/files/model/_filelist.class.php'
935--- qp_inc/files/model/_filelist.class.php 2013-03-18 19:20:42 +0000
936+++ qp_inc/files/model/_filelist.class.php 2013-04-18 18:37:26 +0000
937@@ -1166,9 +1166,12 @@
938
939
940 /**
941+ * Get Current Working Directory
942+ *
943 * Returns cwd, where the accessible directories (below root) are clickable
944 *
945- * @return string cwd as clickable html
946+ * @param boolean true hides most of the dir path, leaving only the "clickable" part
947+ * @return string current working directory (cwd) as clickable html
948 */
949 function get_cwd_clickable( $clickableOnly = true )
950 {
951@@ -1177,7 +1180,7 @@
952 return ' -- '.T_('No directory.').' -- ';
953 }
954
955- // Get the part of the path which is not clickable:
956+ // Get the part of the path which is not clickable
957 $r = substr( $this->_FileRoot->ads_path, 0, strrpos( substr( $this->_FileRoot->ads_path, 0, -1 ), '/' ) + 1 );
958
959 // get the part that is clickable
960
961=== modified file 'qp_inc/files/model/_fileroot.class.php'
962--- qp_inc/files/model/_fileroot.class.php 2013-03-22 21:28:25 +0000
963+++ qp_inc/files/model/_fileroot.class.php 2013-04-18 18:37:26 +0000
964@@ -89,7 +89,7 @@
965 $this->ads_url = $User->get_media_url();
966 return;
967
968- case 'collection':
969+ case 'blog':
970 $BlogCache = & get_Cache( 'BlogCache' );
971 $Blog = & $BlogCache->get_by_ID( $root_in_type_ID );
972 $this->name = $Blog->get( 'shortname' );
973@@ -156,7 +156,7 @@
974 case 'user':
975 return NT_('User roots');
976
977- case 'collection':
978+ case 'blog':
979 return NT_('Blog roots');
980
981 default:
982@@ -172,8 +172,8 @@
983 switch( $root_type )
984 {
985 case 'user':
986+ case 'blog':
987 case 'shared':
988- case 'collection':
989 case 'templates':
990 return $root_type.'_'.$root_in_type_ID;
991 }
992
993=== modified file 'qp_inc/files/model/_filerootcache.class.php'
994--- qp_inc/files/model/_filerootcache.class.php 2013-03-22 21:28:25 +0000
995+++ qp_inc/files/model/_filerootcache.class.php 2013-04-18 18:37:26 +0000
996@@ -53,7 +53,7 @@
997 $bloglist = $BlogCache->load_user_blogs( 'blog_media_browse', $current_User->ID );
998 foreach( $bloglist as $blog_ID )
999 {
1000- if( $Root = & $this->get_by_type_and_ID( 'collection', $blog_ID, true ) )
1001+ if( $Root = & $this->get_by_type_and_ID( 'blog', $blog_ID, true ) )
1002 {
1003 $r[$Root->ID] = & $Root;
1004 }
1005
1006=== modified file 'qp_inc/files/upload.ctrl.php'
1007--- qp_inc/files/upload.ctrl.php 2013-03-12 21:17:25 +0000
1008+++ qp_inc/files/upload.ctrl.php 2013-04-18 18:37:26 +0000
1009@@ -210,6 +210,75 @@
1010 // Remember failed files (and the error messages)
1011 $failedFiles = array();
1012
1013+// This next section will check if we have any file or byte restrictions,
1014+// and if so see if we will even bother trying to upload.
1015+if( isset( $_FILES ) && count( $_FILES ) )
1016+{
1017+ // Some files have been uploaded
1018+ global $upload_maxmaxkb;
1019+ $files_allowed = 99;
1020+ $bytes_allowed = $upload_maxmaxkb;
1021+ $uploading_denied = false;
1022+
1023+ // easiest first check is if we even have limits
1024+ $files_lim = $Settings->get( 'fm_'.$fm_FileRoot->type.'_limit_files' );
1025+ $bytes_lim = $Settings->get( 'fm_'.$fm_FileRoot->type.'_limit_bytes' );
1026+
1027+ if( $files_lim != '' || $bytes_lim != '' )
1028+ {
1029+ // we have a limit of some kind, so we deal with it
1030+ $fm_Filelist = new Filelist( $fm_FileRoot, $ads_list_path );
1031+ $fm_Filelist->load();
1032+ $files = $fm_Filelist->_total_files;
1033+ $bytes = $fm_Filelist->_total_bytes;
1034+
1035+ // have we reached or exceeded our file count limit?
1036+ if( $files_lim != '' )
1037+ {
1038+ if( $files >= $files_lim )
1039+ {
1040+ // yes: error message, get out
1041+ $Messages->add( sprintf( T_('This folder has reached the limit for number of files (%s) - uploading not allowed.'), $files_lim ), 'error' );
1042+ $uploading_denied = true;
1043+ }
1044+ else
1045+ {
1046+ $files_allowed = $files_lim - $files;
1047+ }
1048+ }
1049+
1050+ // have we reached or exceeded our byte count limit?
1051+ if( $bytes_lim != '' )
1052+ {
1053+ $bytes_lim = ( $bytes_lim * 1024 );
1054+ if( $bytes >= $bytes_lim )
1055+ {
1056+ // yes: error message, get out
1057+ $bytes_lim_kb = number_format( $bytes_lim );
1058+ $Messages->add( sprintf( T_('This folder has reached the limit for total bytes (%s) - uploading not allowed.'), $bytes_lim_kb ), 'error' );
1059+ $uploading_denied = true;
1060+ }
1061+ else
1062+ {
1063+ $bytes_allowed = $bytes_lim - $bytes;
1064+ }
1065+ }
1066+ }
1067+}
1068+
1069+// If we reached any limits we display the error message and call it a day
1070+if( $Messages->count('error') )
1071+{
1072+ $AdminUI->disp_html_head();
1073+ // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
1074+ $AdminUI->disp_body_top();
1075+ $AdminUI->disp_global_footer();
1076+ exit(0);
1077+}
1078+
1079+// We have $files_allowed and $bytes_allowed. These are either real limits or
1080+// crazy-high high falsies. We will apply our limits after each upload ...
1081+
1082 // Process uploaded files
1083 if( isset( $_FILES ) && count( $_FILES ) )
1084 {
1085@@ -222,6 +291,22 @@
1086
1087 foreach( $_FILES['uploadfile']['name'] as $lKey => $lName )
1088 {
1089+ // check if our limits have been broken, if so abort out
1090+ if( ! $files_allowed )
1091+ {
1092+ // yes: error message, get out
1093+ $Messages->add( sprintf( T_('This folder has reached the limit for number of files (%s) - uploading &laquo;%s&raquo; cancelled.'), $files_lim, $lName ), 'error' );
1094+ continue; // abort upload for this file
1095+ }
1096+ // have we reached or exceeded our byte count limit?
1097+ if( $bytes_allowed < 1 )
1098+ {
1099+ // yes: error message, get out
1100+ $bytes_lim_kb = number_format( $bytes_lim );
1101+ $Messages->add( sprintf( T_('This folder has reached the limit for total bytes (%s) - uploading &laquo;%s&raquo; cancelled.'), $bytes_lim_kb, $lName ), 'error' );
1102+ continue; // abort upload for this file
1103+ }
1104+
1105 if( empty( $lName ) )
1106 {
1107 // No file name
1108@@ -231,73 +316,69 @@
1109 || ! empty( $uploadfile_desc[$lKey] )
1110 || ! empty( $uploadfile_name[$lKey] ) )
1111 {
1112- // User specified params but NO file!!!
1113- // Remember the file as failed when additional info provided.
1114+ // User specified params but no file; remember the file as failed when additional info provided
1115 $failedFiles[$lKey] = T_( 'Please select a local file to upload.' );
1116 }
1117- // Abort upload for this file
1118- continue;
1119+ continue; // abort upload for this file
1120 }
1121
1122 if( $Settings->get( 'upload_maxkb' )
1123- && $_FILES['uploadfile']['size'][$lKey] > $Settings->get( 'upload_maxkb' )*1024 )
1124+ && $_FILES['uploadfile']['size'][$lKey] > $Settings->get( 'upload_maxkb' )*1024 )
1125 {
1126 // bigger than defined by blog
1127- $failedFiles[$lKey] = sprintf(
1128- T_('The file is too large: %s but the maximum allowed is %s.'),
1129+ $failedFiles[$lKey] = sprintf( T_('The file is too large: %s but the maximum allowed is %s.'),
1130 bytesreadable( $_FILES['uploadfile']['size'][$lKey] ),
1131 bytesreadable( $Settings->get( 'upload_maxkb' )*1024 ) );
1132- // Abort upload for this file
1133- continue;
1134+ continue; // abort upload for this file
1135 }
1136
1137 if( $_FILES['uploadfile']['error'][$lKey] )
1138 {
1139- // PHP has detected an error!
1140+ // PHP has detected an error :: http://php.net/manual/en/features.file-upload.errors.php
1141 switch( $_FILES['uploadfile']['error'][$lKey] )
1142 {
1143+ case UPLOAD_ERR_INI_SIZE:
1144+ $failedFiles[$lKey] = T_('The file exceeds the upload_max_filesize directive in php.ini.');
1145+ continue; // abort upload for this file
1146+
1147 case UPLOAD_ERR_FORM_SIZE:
1148- // The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
1149- // This can easily be changed, so we do not use it.. file size gets checked for real just above
1150+ // The uploaded file exceeds the MAX_FILE_SIZE directive that was specified
1151+ // in the html form. This can easily be changed, so we do not use it. File
1152+ // size gets checked for real just before this switch
1153 break;
1154
1155- case UPLOAD_ERR_INI_SIZE: // bigger than allowed in php.ini
1156- $failedFiles[$lKey] = T_('The file exceeds the upload_max_filesize directive in php.ini.');
1157- // Abort upload for this file
1158- continue;
1159-
1160 case UPLOAD_ERR_PARTIAL:
1161 $failedFiles[$lKey] = T_('The file was only partially uploaded.');
1162- // Abort upload for this file
1163- continue;
1164+ continue; // abort upload for this file
1165
1166 case UPLOAD_ERR_NO_FILE:
1167- // Is probably the same as empty( $lName ) before
1168 $failedFiles[$lKey] = T_('No file was uploaded.');
1169- // Abort upload for this file
1170- continue;
1171+ continue; // abort upload for this file
1172
1173- case 6: // numerical value of UPLOAD_ERR_NO_TMP_DIR
1174- # (min_php: 4.3.10, 5.0.3) case UPLOAD_ERR_NO_TMP_DIR:
1175- // Missing a temporary folder.
1176+ case UPLOAD_ERR_NO_TMP_DIR:
1177 $failedFiles[$lKey] = T_('Missing a temporary folder (upload_tmp_dir in php.ini).');
1178- // Abort upload for this file
1179- continue;
1180+ continue; // abort upload for this file
1181+
1182+ case UPLOAD_ERR_CANT_WRITE:
1183+ $failedFiles[$lKey] = T_('Failed to write file to disk.');
1184+ continue; // abort upload for this file
1185+
1186+ case UPLOAD_ERR_EXTENSION:
1187+ $failedFiles[$lKey] = T_('A PHP extension stopped the file upload.');
1188+ continue; // abort upload for this file
1189
1190 default:
1191 $failedFiles[$lKey] = T_('Unknown error.').' #'.$_FILES['uploadfile']['error'][$lKey];
1192- // Abort upload for this file:
1193- continue;
1194+ continue; // abort upload for this file
1195 }
1196 }
1197
1198- if( !is_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey] ) )
1199+ if( ! is_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey] ) )
1200 {
1201- // Ensure that a malicious user hasn't tried to trick the script into working
1202- // on files upon which it should not be working
1203+ // Ensure that a malicious user hasn't tried to trick the script into
1204+ // working on files upon which it should not be working
1205 $failedFiles[$lKey] = T_('The file does not seem to be a valid upload! It may exceed the upload_max_filesize directive in php.ini.');
1206- // Abort upload for this file
1207- continue;
1208+ continue; // abort upload for this file
1209 }
1210
1211 // If new name on server is specified check the extension and use the new name
1212@@ -325,8 +406,7 @@
1213 {
1214 // Not a file name or not an allowed extension
1215 $failedFiles[$lKey] = $error_filename;
1216- // Abort upload for this file
1217- continue;
1218+ continue; // abort upload for this file
1219 }
1220
1221 // Get File object for requested target location
1222@@ -335,12 +415,11 @@
1223
1224 if( $newFile->exists() )
1225 {
1226- // The file already exists in the target location!
1227+ // The file already exists in the target location
1228 // @todo (0000) Rename/Overwriting (save as filename_<numeric_extension> and
1229 // provide interface to confirm, rename or overwrite)
1230 $failedFiles[$lKey] = sprintf( T_('The file &laquo;%s&raquo; already exists.'), $newFile->dget( 'name' ) );
1231- // Abort upload for this file
1232- continue;
1233+ continue; // abort upload for this file
1234 }
1235
1236 // Trigger plugin event
1237@@ -352,7 +431,7 @@
1238 'size' => & $_FILES['uploadfile']['size'][$lKey],
1239 ) ) )
1240 {
1241- // Plugin returned 'false'. Abort file upload
1242+ // Plugin returned 'false' ... abort upload for this file
1243 continue;
1244 }
1245
1246@@ -360,8 +439,7 @@
1247 if( ! @move_uploaded_file( $_FILES['uploadfile']['tmp_name'][$lKey], $newFile->get_full_path() ) )
1248 {
1249 $failedFiles[$lKey] = T_('An unknown error occurred when moving the uploaded file on the server.');
1250- // Abort upload for this file
1251- continue;
1252+ continue; // abort upload for this file
1253 }
1254
1255 // change to default chmod settings
1256@@ -482,6 +560,10 @@
1257 // Store File object into DB
1258 $newFile->dbsave();
1259
1260+ // subtract this file from $files_allowed and $bytes_allowed
1261+ $files_allowed = $files_allowed - 1;
1262+ $bytes_allowed = $bytes_allowed - $_FILES['uploadfile']['size'][$lKey];
1263+
1264 $Plugins->trigger_event( 'AfterFileSave', array(
1265 'newFile' => & $newFile
1266 ) );
1267
1268=== modified file 'qp_inc/files/views/_file_browse.view.php'
1269--- qp_inc/files/views/_file_browse.view.php 2013-03-18 19:20:42 +0000
1270+++ qp_inc/files/views/_file_browse.view.php 2013-04-18 18:37:26 +0000
1271@@ -303,10 +303,10 @@
1272 echo '<div class="toolbaritem">';
1273 $Form = new Form( NULL, 'fmbar_quick_upload', 'post', 'none', 'multipart/form-data' );
1274 $Form->begin_form();
1275- $Form->hidden_ctrl();
1276+ $Form->hidden( 'ctrl', 'upload' );
1277 $Form->hidden( 'upload_quickmode', 1 );
1278 // The following is mainly a hint to the browser.
1279- $Form->hidden( 'MAX_FILE_SIZE', $Settings->get( 'upload_maxkb' )*1024 );
1280+ $Form->hidden( 'MAX_FILE_SIZE', $Settings->get( 'upload_maxkb' ) * 1024 );
1281 $Form->hiddens_by_key( get_memorized('ctrl') );
1282 echo '<div>';
1283 echo '<input name="uploadfile[]" type="file" size="10" />';
1284
1285=== modified file 'qp_inc/files/views/_file_browse_set.form.php'
1286--- qp_inc/files/views/_file_browse_set.form.php 2013-03-18 19:20:42 +0000
1287+++ qp_inc/files/views/_file_browse_set.form.php 2013-04-18 18:37:26 +0000
1288@@ -22,7 +22,7 @@
1289 {
1290 echo '<p class="note">'.T_('See also:').' ';
1291
1292- if( $fm_FileRoot->type == 'collection' )
1293+ if( $fm_FileRoot->type == 'blog' )
1294 {
1295 echo T_('Blog Settings').' &gt; '.T_('General').' &gt; <a href="?ctrl=blog_settings&tab=general&blog='.$fm_FileRoot->in_type_ID.'">'
1296 .T_('Media directory location').'</a> &bull; ';
1297
1298=== modified file 'qp_inc/files/views/_file_list.inc.php'
1299--- qp_inc/files/views/_file_list.inc.php 2013-03-22 21:28:25 +0000
1300+++ qp_inc/files/views/_file_list.inc.php 2013-04-18 18:37:26 +0000
1301@@ -459,7 +459,7 @@
1302 $title_options = array();
1303 $caption_options = array();
1304
1305- if( $mode != 'upload' && ( $fm_Filelist->get_root_type() == 'collection' || ! empty( $Blog ) ) )
1306+ if( $mode != 'upload' && ( $fm_Filelist->get_root_type() == 'blog' || ! empty( $Blog ) ) )
1307 {
1308 // We are browsing files for a blog
1309 // fp> TODO: use current as default but let user choose into which blog he wants to post
1310
1311=== modified file 'qp_inc/files/views/_file_settings.form.php'
1312--- qp_inc/files/views/_file_settings.form.php 2013-03-22 21:28:25 +0000
1313+++ qp_inc/files/views/_file_settings.form.php 2013-04-18 18:37:26 +0000
1314@@ -66,79 +66,52 @@
1315 return $r;
1316 }
1317
1318-
1319-/**
1320- * Javascript to init hidden/shown state of a fastform field based on a checkbox
1321- *
1322- * EXPERIMENTAL
1323- * Will be moved to another file, I'm leaving it here for a short period, in order to provide context
1324- *
1325- * @param string form field id as used when creating it with the Form class
1326- * @param string DOM id
1327- */
1328-function JS_showhide_ffield_on_checkbox( $field_id, $checkbox_id )
1329-{
1330- return '<script type="text/javascript">
1331- document.getElementById("ffield_'.$field_id.'").style.display = (document.getElementById("'.$checkbox_id.'").checked ? "" : "none")
1332- </script>';
1333-}
1334-
1335-
1336-/**
1337- * Javascript hide/show all DOM elements with a particular class based on current checkbox
1338- *
1339- * EXPERIMENTAL
1340- * Will be moved to another file, I'm leaving it here for a short period, in order to provide context
1341- *
1342- * @param string DOM class name
1343- */
1344-function JS_showhide_class_on_this( $class )
1345-{
1346- return 'if( this.checked )
1347- {
1348- jQuery(".'.$class.'").show();
1349- }
1350- else
1351- {
1352- jQuery(".'.$class.'").hide();
1353- }';
1354-}
1355-
1356-
1357-/**
1358- * Javascript hide/show a fastform field based on current checkbox
1359- *
1360- * EXPERIMENTAL
1361- * Will be moved to another file, I'm leaving it here for a short period, in order to provide context
1362- *
1363- * @param string DOM id
1364- */
1365-function JS_showhide_ffield_on_this( $field_id )
1366-{
1367- return 'document.getElementById("ffield_'.$field_id.'").style.display = (this.checked ? "" : "none")';
1368-}
1369-
1370 $Form = new Form( NULL, 'files_checkchanges' );
1371 $Form->begin_form( 'fform', T_('File Settings') );
1372 $Form->hidden_ctrl();
1373 $Form->hidden( 'action', 'update' );
1374
1375 $Form->begin_fieldset( T_('Accessible file roots'), array( 'id' => 'ffset_fileroots', 'class' => 'additional_file_settings' ) );
1376-$Form->checkbox( 'fm_enable_roots_blog', $Settings->get( 'fm_enable_roots_blog' ), T_('Enable blog directories'), T_('Check to enable root directories for blogs.' ) );
1377-$Form->checkbox( 'fm_enable_roots_user', $Settings->get( 'fm_enable_roots_user' ), T_('Enable user directories'), T_('Check to enable root directories for users.' ) );
1378-$Form->checkbox( 'fm_enable_roots_shared', $Settings->get( 'fm_enable_roots_shared' ), T_('Enable shared directory'), T_('Check to enable shared root directory.' ) );
1379-$Form->checkbox( 'fm_enable_roots_templates', $Settings->get( 'fm_enable_roots_templates' ), T_('Enable templates directory'), T_('Check to enable root directory for templates.' ) ); // fp> note: meaning may change to 1 dir per (installed) template
1380+$Form->checkbox_input( 'fm_enable_roots_blog', $Settings->get( 'fm_enable_roots_blog' ), T_('Enable blog directories'),
1381+ array( 'note' => T_('Check to enable root directories for blogs.'),
1382+ 'onclick' => 'document.getElementById("fm_blog_limits").style.display = (this.checked==true ? "" : "none") ;' ) );
1383+echo '<div id="fm_blog_limits">';
1384+$Form->text_input( 'fm_blog_limit_files', $Settings->get( 'fm_blog_limit_files' ), 3, T_('blog file limit'), T_('This limits how many files a blog folder can have. Leave empty for no limit.') );
1385+$Form->text_input( 'fm_blog_limit_bytes', $Settings->get( 'fm_blog_limit_bytes' ), 6, T_('blog dir size'), T_('KB. This limits how many kilobytes a blog folder can have. Leave empty for no limit.' ) );
1386+echo '</div>';
1387+$Form->checkbox_input( 'fm_enable_roots_user', $Settings->get( 'fm_enable_roots_user' ), T_('Enable user directories'),
1388+ array( 'note' => T_('Check to enable root directories for users.' ),
1389+ 'onclick' => 'document.getElementById("fm_user_limits").style.display = (this.checked==true ? "" : "none") ;' ) );
1390+echo '<div id="fm_user_limits">';
1391+$Form->text_input( 'fm_user_limit_files', $Settings->get( 'fm_user_limit_files' ), 3, T_('user file limit'), T_('This limits how many files a user folder can have. Leave empty for no limit.') );
1392+$Form->text_input( 'fm_user_limit_bytes', $Settings->get( 'fm_user_limit_bytes' ), 6, T_('user dir size'), T_('KB. This limits how many kilobytes a user folder can have. Leave empty for no limit.' ) );
1393+echo '</div>';
1394+$Form->checkbox_input( 'fm_enable_roots_shared', $Settings->get( 'fm_enable_roots_shared' ), T_('Enable shared directory'),
1395+ array( 'note' => T_('Check to enable shared root directory.' ),
1396+ 'onclick' => 'document.getElementById("fm_shared_limits").style.display = (this.checked==true ? "" : "none") ;' ) );
1397+echo '<div id="fm_shared_limits">';
1398+$Form->text_input( 'fm_shared_limit_files', $Settings->get( 'fm_shared_limit_files' ), 3, T_('shared file limit'), T_('This limits how many files a shared folder can have. Leave empty for no limit.') );
1399+$Form->text_input( 'fm_shared_limit_bytes', $Settings->get( 'fm_shared_limit_bytes' ), 6, T_('shared dir size'), T_('KB. This limits how many kilobytes a shared folder can have. Leave empty for no limit.' ) );
1400+echo '</div>';
1401+$Form->checkbox_input( 'fm_enable_roots_templates', $Settings->get( 'fm_enable_roots_templates' ), T_('Enable templates directory'),
1402+ array( 'note' => T_('Check to enable root directory for templates.' ),
1403+ 'onclick' => 'document.getElementById("fm_templates_limits").style.display = (this.checked==true ? "" : "none") ;' ) );
1404+echo '<div id="fm_templates_limits">';
1405+$Form->text_input( 'fm_templates_limit_files', $Settings->get( 'fm_templates_limit_files' ), 3, T_('template file limit'), T_('This limits how many files a template folder can have. Leave empty for no limit.') );
1406+$Form->text_input( 'fm_templates_limit_bytes', $Settings->get( 'fm_templates_limit_bytes' ), 6, T_('template dir size'), T_('KB. This limits how many kilobytes a template folder can have. Leave empty for no limit.' ) );
1407+echo '</div>';
1408 $Form->end_fieldset();
1409
1410 $Form->begin_fieldset( T_('File creation options'), array( 'id' => 'ffset_filecreate', 'class' => 'additional_file_settings' ) );
1411 $Form->checkbox( 'fm_enable_create_dir', $Settings->get( 'fm_enable_create_dir' ), T_('Enable creation of folders'), T_('Check to enable creation of directories.' ) );
1412 $Form->checkbox( 'fm_enable_create_file', $Settings->get( 'fm_enable_create_file' ), T_('Enable creation of files'), T_('Check to enable creation of files.' ) );
1413 $Form->checkbox_input( 'upload_enabled', $Settings->get( 'upload_enabled' ), T_('Enable upload of files'), array(
1414- 'note' => T_('Check to allow uploading files in general.' ), 'onclick' => JS_showhide_ffield_on_this('upload_maxkb') ) );
1415+ 'note' => T_('Check to allow uploading files in general.' ),
1416+ 'onclick' => 'document.getElementById("upload_maxkb_div").style.display = (this.checked==true ? "" : "none") ;' ) );
1417+echo '<div id="upload_maxkb_div">';
1418 $Form->text_input( 'upload_maxkb', $Settings->get( 'upload_maxkb' ), 6, T_('Maximum upload filesize'),
1419 sprintf( /* TRANS: first %s is setting/var name, second is file name, third is limit value */ T_('KB. This cannot be higher than your PHP/Webserver setting and the limit of %s (in %s), which is currently %s!'), '$upload_maxmaxkb', '/qp_config/_advanced.php', $upload_maxmaxkb.' '.T_('KB') ), array( 'maxlength' => 7, 'required' => true ) );
1420-// Javascript to init hidden/shown state:
1421-echo JS_showhide_ffield_on_checkbox( 'upload_maxkb', 'upload_enabled' );
1422+echo '</div>';
1423 $Form->end_fieldset();
1424
1425 $Form->begin_fieldset( T_('Advanced options'), array( 'id' => 'ffset_fileadvanced', 'class' => 'additional_file_settings' ) );
1426
1427=== modified file 'qp_inc/generic/model/_genericelement.class.php'
1428--- qp_inc/generic/model/_genericelement.class.php 2013-03-18 19:20:42 +0000
1429+++ qp_inc/generic/model/_genericelement.class.php 2013-04-18 18:37:26 +0000
1430@@ -79,8 +79,8 @@
1431 $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ), T_('cancel') );
1432 }
1433 $Form->begin_form( 'fform', $creating ? T_('New element') : T_('Element') );
1434- $Form->hidden_ctrl();
1435 $Form->hidden( 'action', $creating ? 'create' : 'update' );
1436+ $Form->hidden( 'ctrl', $ctrl );
1437 $Form->hiddens_by_key( get_memorized( 'action, ctrl' ) );
1438 $Form->text_input( $this->dbprefix.'name', $this->name, $edited_name_maxlen, T_('name'), '', array( 'required' => true ) );
1439 if( $creating )
1440
1441=== modified file 'qp_inc/generic/views/_generic_category.form.php'
1442--- qp_inc/generic/views/_generic_category.form.php 2013-03-18 19:20:42 +0000
1443+++ qp_inc/generic/views/_generic_category.form.php 2013-04-18 18:37:26 +0000
1444@@ -22,8 +22,8 @@
1445 $Form = new Form( NULL, 'form' );
1446 $Form->global_icon( T_('Cancel editing!'), 'close', regenerate_url( 'action' ), T_('cancel') );
1447 $Form->begin_form( 'fform', $creating ? T_('New category') : T_('Category') );
1448-$Form->hidden_ctrl();
1449 $Form->hidden( 'action', $creating ? 'create' : 'update' );
1450+$Form->hidden( 'ctrl', $ctrl );
1451 $Form->hiddens_by_key( get_memorized( 'action, ctrl' ) );
1452
1453 $Form->begin_fieldset( T_('Properties') );
1454
1455=== modified file 'qp_inc/plugins/_plugin.class.php'
1456--- qp_inc/plugins/_plugin.class.php 2013-03-22 21:28:25 +0000
1457+++ qp_inc/plugins/_plugin.class.php 2013-04-18 18:37:26 +0000
1458@@ -809,6 +809,17 @@
1459
1460
1461 /**
1462+ * Event handler: Turns on "extended profile" feature
1463+ *
1464+ * Give it a true to give each user a second page of profile options
1465+ */
1466+ function ActivateExtendedProfile( $activate = false )
1467+ {
1468+ return false;
1469+ }
1470+
1471+
1472+ /**
1473 * Event handler: Gets invoked in /admin.php after the menu structure is built
1474 *
1475 * Gets invoked in /admin.php for every backoffice page after the menu structure
1476
1477=== modified file 'qp_inc/plugins/_plugin.funcs.php'
1478--- qp_inc/plugins/_plugin.funcs.php 2013-03-12 06:26:03 +0000
1479+++ qp_inc/plugins/_plugin.funcs.php 2013-04-18 18:37:26 +0000
1480@@ -925,7 +925,8 @@
1481 if( isset( $meta['valid_pattern'] ) )
1482 {
1483 $param_pattern = is_array( $meta['valid_pattern'] ) ? $meta['valid_pattern']['pattern'] : $meta['valid_pattern'];
1484- if( ! preg_match( $param_pattern, $value ) )
1485+ // checking for not empty values is a lazy solution to an unrequired field making an "error" even though it works correctly
1486+ if( ! preg_match( $param_pattern, $value ) && $value != '' )
1487 {
1488 $param_error = is_array( $meta['valid_pattern'] ) ? $meta['valid_pattern']['error'] : sprintf(T_('The value is invalid. It must match the regular expression &laquo;%s&raquo;.'), $param_pattern);
1489 param_error( $param_name, $param_error );
1490
1491=== modified file 'qp_inc/plugins/model/_plugins_admin.class.php'
1492--- qp_inc/plugins/model/_plugins_admin.class.php 2013-03-18 19:20:42 +0000
1493+++ qp_inc/plugins/model/_plugins_admin.class.php 2013-04-18 18:37:26 +0000
1494@@ -81,6 +81,7 @@
1495 if( empty( $supported_events ) )
1496 {
1497 $supported_events = array(
1498+ 'ActivateExtendedProfile' => 'Turns on "extended profile" feature',
1499 'AdminAfterPageFooter' => 'This gets called after the backoffice HTML footer has been displayed.',
1500 'AdminDisplayEditorButton' => 'Display action buttons on the edit screen(s)',
1501 'AdminDisplayCommentToolbar' => 'Display a toolbar on the admin-side feedback form',
1502
1503=== modified file 'qp_inc/sessions/_sessions.init.php'
1504--- qp_inc/sessions/_sessions.init.php 2013-03-22 21:28:25 +0000
1505+++ qp_inc/sessions/_sessions.init.php 2013-04-18 18:37:26 +0000
1506@@ -27,15 +27,12 @@
1507
1508 // Aliases for table names
1509 $app_db_config['aliases']['T_basedomains'] = $app_db_tableprefix.'basedomains';
1510-$app_db_config['aliases']['T_goals'] = $app_db_tableprefix.'track__goal';
1511-$app_db_config['aliases']['T_goal_hits'] = $app_db_tableprefix.'track__goalhit';
1512+$app_db_config['aliases']['T_goals'] = $app_db_tableprefix.'goals';
1513+$app_db_config['aliases']['T_goal_hits'] = $app_db_tableprefix.'goal_hits';
1514 $app_db_config['aliases']['T_hitlog'] = $app_db_tableprefix.'hitlog';
1515-$app_db_config['aliases']['T_keyphrases'] = $app_db_tableprefix.'track__keyphrase';
1516+$app_db_config['aliases']['T_keyphrases'] = $app_db_tableprefix.'keyphrases';
1517 $app_db_config['aliases']['T_sessions'] = $app_db_tableprefix.'sessions';
1518 $app_db_config['aliases']['T_useragents'] = $app_db_tableprefix.'useragents';
1519-$app_db_config['aliases']['T_track__goal'] = $app_db_tableprefix.'track__goal'; // old, going away
1520-$app_db_config['aliases']['T_track__goalhit'] = $app_db_tableprefix.'track__goalhit'; // old, going away
1521-$app_db_config['aliases']['T_track__keyphrase'] = $app_db_tableprefix.'track__keyphrase'; // old, going away
1522
1523 // Controller mappings
1524 $ctrl_mappings['stats'] = 'sessions/stats.ctrl.php';
1525
1526=== modified file 'qp_inc/settings/model/_generalsettings.class.php'
1527--- qp_inc/settings/model/_generalsettings.class.php 2013-03-12 06:26:03 +0000
1528+++ qp_inc/settings/model/_generalsettings.class.php 2013-04-18 18:37:26 +0000
1529@@ -58,7 +58,7 @@
1530 'newusers_canregister' => '0',
1531 'newusers_level' => '1',
1532 // "Display options" section
1533- 'default_admin_template' => 'wind',
1534+ 'default_admin_template' => 'earth',
1535 // "Email validation" section
1536 'newusers_mustvalidate' => '1',
1537 'newusers_revalidate_emailchg' => '0',
1538@@ -80,9 +80,17 @@
1539 // GLOBAL SETTINGS -> FILES
1540 // "Accessible file roots" section
1541 'fm_enable_roots_blog' => '1',
1542+ 'fm_blog_limit_files' => '',
1543+ 'fm_blog_limit_bytes' => '',
1544 'fm_enable_roots_user' => '1',
1545+ 'fm_user_limit_files' => '',
1546+ 'fm_user_limit_bytes' => '',
1547 'fm_enable_roots_shared' => '0',
1548+ 'fm_shared_limit_files' => '',
1549+ 'fm_shared_limit_bytes' => '',
1550 'fm_enable_roots_templates' => '0',
1551+ 'fm_templates_limit_files' => '',
1552+ 'fm_templates_limit_bytes' => '',
1553 // "File creation options" section
1554 'fm_enable_create_dir' => '1',
1555 'fm_enable_create_file' => '1',
1556
1557=== modified file 'qp_inc/templates/model/_template.class.php'
1558--- qp_inc/templates/model/_template.class.php 2013-03-22 21:28:25 +0000
1559+++ qp_inc/templates/model/_template.class.php 2013-04-18 18:37:26 +0000
1560@@ -194,6 +194,9 @@
1561 * Compare discovered containers to database info
1562 *
1563 * Called when reloading a template
1564+ *
1565+ * @todo (3085) EdB> There seems to be a bug in here that leaves mention of a
1566+ * container that was removed when doing a reload.
1567 */
1568 function db_compare_containers()
1569 {
1570
1571=== modified file 'qp_inc/tools/views/_system_list.view.php'
1572--- qp_inc/tools/views/_system_list.view.php 2013-03-18 19:20:42 +0000
1573+++ qp_inc/tools/views/_system_list.view.php 2013-04-18 18:37:26 +0000
1574@@ -39,19 +39,8 @@
1575 // Version check
1576 $app_timestamp = mysql2timestamp( $app_date );
1577 $app_date = date_i18n( locale_datefmt(), $app_timestamp );
1578-
1579-$bzr_revno = get_bzr_revision();
1580-if( $bzr_revno )
1581-{
1582- /* TRANS: First %s: App version, second %s: release date, third %d: Bazaar revision number */
1583- $ver_val = sprintf( T_( '%s released on %s &mdash; Bazaar revision %d' ), $app_version, $app_date, $bzr_revno );
1584-}
1585-else
1586-{
1587- /* TRANS: First %s: App version, second %s: release date */
1588- $ver_val = sprintf( T_( '%s released on %s' ), $app_version, $app_date );
1589-}
1590-init_system_check( sprintf( T_( '%s version' ), $app_name ), $ver_val );
1591+$ver_val = sprintf( T_('%s released on %s'), $app_version, $app_date );
1592+init_system_check( sprintf( T_('%s version'), $app_name ), $ver_val );
1593
1594 // age check
1595 $app_age = ( $localtimenow - $app_timestamp ) / 3600 / 24 / 30; // approx age in months
1596@@ -63,13 +52,6 @@
1597 {
1598 disp_system_check( 'warning', sprintf( T_('This version is aging. You may want to check for newer releases on').' <a href="'.$app_homepage.'">'.$app_name.'</a>.' ) );
1599 }
1600-elseif( $bzr_revno )
1601-{
1602- disp_system_check( 'ok', sprintf( /* TRANS: %d: Bazaar revision number */
1603- T_( 'This is a development version and not an official release, but it should be mostly operational.<br />'
1604- .'If you report bugs in this version, mention that you are using the development version with '
1605- .'<strong>Bazaar revision number %d</strong>.' ), $bzr_revno ) );
1606-}
1607 else
1608 {
1609 disp_system_check( 'ok' );
1610
1611=== modified file 'qp_inc/users/model/_user.class.php'
1612--- qp_inc/users/model/_user.class.php 2013-03-22 21:28:25 +0000
1613+++ qp_inc/users/model/_user.class.php 2013-04-18 18:37:26 +0000
1614@@ -903,13 +903,34 @@
1615 'align' => '',
1616 ), $params );
1617
1618- $FileCache = & get_Cache( 'FileCache' );
1619- $Avatar = & $FileCache->get_by_ID( $this->avatar_ID, false, false );
1620-
1621- return array(
1622- 'tag' => $Avatar->get_thumb_imgtag( $params['size'], $params['class'], $params['align'] ),
1623- 'root' => $Avatar->_FileRoot->ID,
1624- );
1625+
1626+ global $DB;
1627+ $query = 'SELECT file_path FROM T_files WHERE file_root_type = \'user\' AND file_ID = '.$this->avatar_ID;
1628+ if( $file_name = $DB->get_var( $query ) )
1629+ {
1630+ $FileCache = & get_Cache( 'FileCache' );
1631+ $Avatar = & $FileCache->get_by_root_and_path( 'user', $this->ID, $file_name );
1632+ return array(
1633+ 'tag' => $Avatar->get_thumb_imgtag( $params['size'], $params['class'], $params['align'] ),
1634+ 'root' => $Avatar->_FileRoot->ID,
1635+ );
1636+ }
1637+ elseif( is_null( $file_name ) )
1638+ {
1639+ // avatar file must have been deleted is all I can think of
1640+ $UserCache = & get_Cache( 'UserCache' );
1641+ $edited_User = & $UserCache->get_by_ID( $this->ID, false );
1642+ $edited_User->set( 'avatar_file_ID', NULL, true );
1643+ $edited_User->dbupdate();
1644+ // return an empty array as avatar
1645+ return array( 'tag' => '', 'root' => '' );
1646+ }
1647+ else
1648+ {
1649+ // this is a total mystery ... no file name but not null?
1650+ debug_die( 'file id '.$this->avatar_ID.' not found but file_name not null ... which is crazy' );
1651+ }
1652+
1653 }
1654
1655
1656
1657=== modified file 'qp_inc/users/model/_user.funcs.php'
1658--- qp_inc/users/model/_user.funcs.php 2013-03-22 21:28:25 +0000
1659+++ qp_inc/users/model/_user.funcs.php 2013-04-18 18:37:26 +0000
1660@@ -276,7 +276,7 @@
1661
1662
1663 /**
1664- * Template tag: Output a link to the backoffice
1665+ * Template tag: Display a link to the backoffice
1666 *
1667 * Usually provided in templates in order for newbies to find the admin interface
1668 * more easily...
1669@@ -284,9 +284,10 @@
1670 * @todo (2140) EdB> change to array of params
1671 * @param string To be displayed before the link.
1672 * @param string To be displayed after the link.
1673- * @param string The page/controller to link to inside of {@link $admin_url}
1674 * @param string Text for the link.
1675 * @param string Title for the link.
1676+ * @param string The page/controller to link to inside of {@link $admin_url}
1677+ * @param string the returned string if the user should not see the admin link
1678 */
1679 function user_admin_link( $before = '', $after = '', $link_text = '', $link_title = '#', $not_visible = '' )
1680 {
1681@@ -295,16 +296,16 @@
1682
1683
1684 /**
1685- * Template tag: Get a link to the backoffice
1686+ * Get a link to the backoffice
1687 *
1688 * Usually provided in templates in order for newbies to find the admin interface
1689 * more easily...
1690 *
1691 * @param string To be displayed before the link.
1692 * @param string To be displayed after the link.
1693- * @param string The page/controller to link to inside of {@link $admin_url}
1694 * @param string Text for the link.
1695 * @param string Title for the link.
1696+ * @param string The returned string if the user should not see the admin link
1697 * @return string
1698 */
1699 function get_user_admin_link( $before = '', $after = '', $link_text = '', $link_title = '#', $not_visible = '' )
1700@@ -343,19 +344,30 @@
1701
1702 /**
1703 * Template tag: Display a link to user profile
1704+ *
1705+ * @param string To be displayed before the link.
1706+ * @param string To be displayed after the link.
1707+ * @param string Text for the link.
1708+ * @param string Title for the link.
1709+ * @param integer The ID of the user we want a profile link for
1710 */
1711-function user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#' )
1712+function user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#', $user_id = '#' )
1713 {
1714- echo get_user_profile_link( $before, $after, $link_text, $link_title );
1715+ echo get_user_profile_link( $before, $after, $link_text, $link_title, $user_id );
1716 }
1717
1718
1719 /**
1720- * Template tag: Get a link to user profile
1721+ * Get a link to user profile
1722 *
1723+ * @param string To be displayed before the link.
1724+ * @param string To be displayed after the link.
1725+ * @param string Text for the link.
1726+ * @param string Title for the link.
1727+ * @param integer The ID of the user we want a profile for
1728 * @return string|false
1729 */
1730-function get_user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#' )
1731+function get_user_profile_link( $before = '', $after = '', $link_text = '', $link_title = '#', $user_id = '#' )
1732 {
1733 global $current_User;
1734
1735@@ -372,10 +384,20 @@
1736 {
1737 $link_text = str_replace( '%s', $current_User->login, $link_text );
1738 }
1739- if( $link_title == '#' ) $link_title = T_('Edit your profile');
1740+
1741+ if( $link_title == '#' )
1742+ {
1743+ $link_title = T_('Edit your profile');
1744+ }
1745+
1746+ if( $user_id == '#' )
1747+ {
1748+ $user_id = $current_User->ID;
1749+ }
1750+
1751
1752 $r = $before
1753- .'<a href="'.get_user_profile_url().'" title="'.$link_title.'">'
1754+ .'<a href="'.get_user_profile_url( $user_id ).'" title="'.$link_title.'">'
1755 .sprintf( $link_text, $current_User->login )
1756 .'</a>'
1757 .$after;
1758@@ -386,8 +408,11 @@
1759
1760 /**
1761 * Get URL to edit user profile
1762+ *
1763+ * @param integer The ID of the user we want a profile for
1764+ * @return string The link to profile, either in admin or public with redirect
1765 */
1766-function get_user_profile_url()
1767+function get_user_profile_url( $user_id )
1768 {
1769 global $admin_url;
1770 global $Blog;
1771@@ -401,7 +426,7 @@
1772 }
1773 else
1774 {
1775- $url = url_add_param( $Blog->gen_blogurl(), 'disp=profile&amp;redirect_to='.rawurlencode( $ReqURI ) );
1776+ $url = url_add_param( $Blog->gen_blogurl(), 'disp=profile&amp;user_ID='.$user_id.'&amp;redirect_to='.rawurlencode( $ReqURI ) );
1777 }
1778
1779 return $url;
1780
1781=== modified file 'qp_inc/users/model/_usersettings.class.php'
1782--- qp_inc/users/model/_usersettings.class.php 2013-03-22 21:28:25 +0000
1783+++ qp_inc/users/model/_usersettings.class.php 2013-04-18 18:37:26 +0000
1784@@ -35,7 +35,7 @@
1785 'fm_allowfiltering' => 'simple',
1786 'blogperms_layout' => 'default', // selected view in blog (user/group) perms
1787 'login_multiple_sessions' => 1, // allow multiple concurrent sessions? (PARAMOUNT ON DEMO SERVER)
1788- 'results_per_page' => 20,
1789+ 'results_per_page' => 50,
1790 'num_admin_blogs' => 10,
1791 );
1792
1793
1794=== modified file 'qp_inc/users/users.ctrl.php'
1795--- qp_inc/users/users.ctrl.php 2013-03-22 21:28:25 +0000
1796+++ qp_inc/users/users.ctrl.php 2013-04-18 18:37:26 +0000
1797@@ -169,6 +169,17 @@
1798 }
1799 }
1800
1801+// add menu options if a plugin needs them and we are on a user page
1802+global $Plugins;
1803+
1804+if( $Plugins->trigger_event_first_true( 'ActivateExtendedProfile' ) && isset( $user_ID ) )
1805+{
1806+ $AdminUI->add_menu_entries( 'users', array(
1807+ 'profile' => array( 'text' => 'Profile', 'href' => $dispatcher.'?ctrl=users&amp;user_ID='.$user_ID ),
1808+ 'users_ext' => array( 'text' => 'Extended Profile', 'href' => $dispatcher.'?ctrl=users&amp;x=1&amp;user_ID='.$user_ID )
1809+ ) );
1810+}
1811+
1812 // Perform actions, if there were no errors
1813 if( ! $Messages->count('error') )
1814 {
1815
1816=== modified file 'qp_inc/users/views/_user.form.php'
1817--- qp_inc/users/views/_user.form.php 2013-03-18 19:20:42 +0000
1818+++ qp_inc/users/views/_user.form.php 2013-04-18 18:37:26 +0000
1819@@ -20,6 +20,7 @@
1820 global $AdminUI;
1821 global $current_User;
1822 global $edited_User;
1823+global $lock_id_and_nick;
1824 global $Plugins;
1825 global $Settings;
1826 global $UserSettings;
1827@@ -112,14 +113,29 @@
1828 if( $action != 'view_user' )
1829 {
1830 // We can edit the values
1831- $Form->text_input( 'edited_user_login', $edited_User->login, 20, T_('Login'), '', array( 'required' => true ) );
1832+ if( $lock_id_and_nick && ( ! $current_User->ID === 1 ) )
1833+ {
1834+ // lock is set and user #1 is not out there ... no editing allowed
1835+ $Form->info( T_('Login'), $edited_User->get( 'login' ) );
1836+ $Form->hidden( 'edited_user_login', $edited_User->login );
1837+ }
1838+ else
1839+ {
1840+ $Form->text_input( 'edited_user_login', $edited_User->login, 20, T_('Login'), '', array( 'required' => true ) );
1841+ }
1842 $Form->text_input( 'edited_user_firstname', $edited_User->firstname, 20, T_('First name'), '', array( 'maxlength' => 50 ) );
1843 $Form->text_input( 'edited_user_lastname', $edited_User->lastname, 20, T_('Last name'), '', array( 'maxlength' => 50 ) );
1844- $Form->text_input( 'edited_user_nickname', $edited_User->nickname, 20, T_('Nickname'), '', array( 'maxlength' => 50, 'required' => true ) );
1845+ if( $lock_id_and_nick && ( ! $current_User->ID === 1 ) )
1846+ {
1847+ // lock is set and user #1 is not out there ... no editing allowed
1848+ $Form->info( T_('Nickname'), $edited_User->get( 'nickname' ) );
1849+ $Form->hidden( 'edited_user_nickname', $edited_User->nickname );
1850+ }
1851+ else
1852+ {
1853+ $Form->text_input( 'edited_user_nickname', $edited_User->nickname, 20, T_('Nickname'), '', array( 'maxlength' => 50, 'required' => true ) );
1854+ }
1855 $Form->select( 'edited_user_idmode', $edited_User->get( 'idmode' ), array( &$edited_User, 'callback_optionsForIdMode' ), T_('Identity shown') );
1856- $Form->checkbox( 'edited_user_showonline', $edited_User->get( 'showonline' ), T_('Show online'), T_('Check this to be displayed as online when visiting the site.') );
1857- $Form->checkbox( 'edited_user_set_login_multiple_sessions', $UserSettings->get( 'login_multiple_sessions', $edited_User->ID), T_('Multiple sessions'),
1858- T_('Check this if you want to log in from different computers/browsers at the same time. Otherwise, logging in from a new computer/browser will disconnect you on the previous one.') );
1859 }
1860 else
1861 {
1862@@ -129,17 +145,14 @@
1863 $Form->info( T_('Last name'), $edited_User->get( 'lastname' ) );
1864 $Form->info( T_('Nickname'), $edited_User->get( 'nickname' ) );
1865 $Form->info( T_('Identity shown'), $edited_User->get( 'preferredname' ) );
1866- $Form->info( T_('Show online'), ( $edited_User->get( 'showonline' ) ) ? T_('yes') : T_('no') );
1867- $Form->info( T_('Multiple sessions'), ( $UserSettings->get( 'login_multiple_sessions', $edited_User->ID ) ? T_('Allowed') : T_('Forbidden') ) );
1868 }
1869-$Form->end_fieldset();
1870
1871-// "Extended Identity" section
1872 ob_start();
1873-$Form->begin_fieldset( T_('Extended Identity') );
1874 ob_start();
1875 $Plugins->restart();
1876-while( $loop_Plugin = & $Plugins->get_next() )
1877+// $edited_User->ID is 0 if we are copying/creating, so the avatar and biography
1878+// bits can't be added at this point. too lazy to really fix it is the thing ...
1879+while( $loop_Plugin = & $Plugins->get_next() && $edited_User->ID )
1880 {
1881 if( $loop_Plugin->UserSettings )
1882 {
1883@@ -154,7 +167,7 @@
1884 // get avatar info
1885 $avatar_info = $edited_User->get_avatar( array(
1886 'size' => 'crop-64x64',
1887- 'class' => 'floatleft',
1888+ 'class' => 'floatleft'
1889 ) );
1890 $avatar_tag = $avatar_info['tag']; // '' if no avatar
1891 $avatar_root = $avatar_info['root']; // '' if no avatar
1892@@ -179,7 +192,6 @@
1893 }
1894 $Form->info( T_( 'Avatar' ), $avatar_tag );
1895 }
1896-
1897 // biography field
1898 if( $l_name == 'use_biography' )
1899 {
1900@@ -187,13 +199,17 @@
1901 {
1902 $Form->textarea( 'edited_user_biography', $edited_User->get( 'biography' ), 5, T_('Biography'), T_('This is called for by a plugin so we do not know what it is used for.'), 50, 'large' );
1903 }
1904+ else
1905+ {
1906+ $Form->info( T_('Biography'), $edited_User->get( 'biography' ), T_('This is called for by a plugin so we do not know what it is used for.') );
1907+ }
1908 }
1909 }
1910 }
1911 }
1912 }
1913 $has_contents = strlen( ob_get_contents() );
1914-$Form->end_fieldset();
1915+//$Form->end_fieldset();
1916 if( $has_contents )
1917 {
1918 ob_end_flush();
1919@@ -206,6 +222,22 @@
1920 ob_end_clean();
1921 }
1922
1923+if( $action != 'view_user' )
1924+{
1925+ // We can edit the values
1926+ if( $lock_id_and_nick && ( ! $current_User->ID === 1 ) )
1927+ $Form->checkbox( 'edited_user_showonline', $edited_User->get( 'showonline' ), T_('Show online'), T_('Check this to be displayed as online when visiting the site.') );
1928+ $Form->checkbox( 'edited_user_set_login_multiple_sessions', $UserSettings->get( 'login_multiple_sessions', $edited_User->ID), T_('Multiple sessions'),
1929+ T_('Check this if you want to log in from different computers/browsers at the same time. Otherwise, logging in from a new computer/browser will disconnect you on the previous one.') );
1930+}
1931+else
1932+{
1933+ // display only
1934+ $Form->info( T_('Show online'), ( $edited_User->get( 'showonline' ) ) ? T_('yes') : T_('no') );
1935+ $Form->info( T_('Multiple sessions'), ( $UserSettings->get( 'login_multiple_sessions', $edited_User->ID ) ? T_('Allowed') : T_('Forbidden') ) );
1936+}
1937+$Form->end_fieldset();
1938+
1939 // "Password" section
1940 if( $action != 'view_user' )
1941 {
1942@@ -236,19 +268,14 @@
1943 // We can edit the values
1944 $Form->select( 'edited_user_locale', $edited_User->get( 'locale' ), 'locale_options_return', T_('Preferred locale'), T_('Preferred locale for admin interface, notifications, etc.'));
1945 $Form->select_input_array( 'edited_user_admin_template', $value_admin_template, get_admin_templates(), T_('Admin template'), T_('The template defines how the backoffice appears to you.') );
1946-
1947 // To display or hide icon legend
1948 $Form->checkbox( 'edited_user_legend', $UserSettings->get( 'display_icon_legend', $edited_User->ID ), T_('Display icon legend'), T_('Display a legend at the bottom of every page including all action icons used on that page.') );
1949-
1950 // To activate or deactivate bozo validator
1951 $Form->checkbox( 'edited_user_bozo', $UserSettings->get( 'control_form_abortions', $edited_User->ID ), T_('Control form closing'), T_('This will alert you if you fill in data into a form and try to leave the form before submitting the data.') );
1952-
1953 // To activate focus on first form input text
1954 $Form->checkbox( 'edited_user_focusonfirst', $UserSettings->get( 'focus_on_first_input', $edited_User->ID ), T_('Focus on first field'), T_('The focus will automatically go to the first input text field.') );
1955-
1956 // Number of results per page
1957 $Form->text( 'edited_user_results_per_page', $UserSettings->get( 'results_per_page', $edited_User->ID ), 3, T_('Results per page'), T_('Number of rows displayed in results tables.') );
1958-
1959 // Number of blogs to display in the admin
1960 $Form->text( 'edited_user_num_admin_blogs', $UserSettings->get( 'num_admin_blogs', $edited_User->ID ), 2, T_('Blog menu length'), T_('Number of blogs displayed in the admin console before using a select box') );
1961 }
1962@@ -263,7 +290,6 @@
1963 $Form->end_fieldset();
1964
1965 // "Plugin options" section
1966-
1967 if( $action != 'view_user' )
1968 {
1969 // We can edit the values
1970
1971=== modified file 'qp_inc/users/views/_user_list.view.php'
1972--- qp_inc/users/views/_user_list.view.php 2013-03-18 19:20:42 +0000
1973+++ qp_inc/users/views/_user_list.view.php 2013-04-18 18:37:26 +0000
1974@@ -16,11 +16,11 @@
1975 global $Settings;
1976 global $usedgroups;
1977
1978-// query which groups have users (in order to prevent deletion of groups which have users)
1979+// query which groups have users (to prevent deletion of groups which have users)
1980 $usedgroups = $DB->get_col( 'SELECT grp_ID
1981 FROM T_groups
1982 INNER JOIN T_users ON user_grp_ID = grp_ID
1983- GROUP BY grp_ID');
1984+ GROUP BY grp_ID' );
1985
1986 // Query user list
1987 $keywords = param( 'keywords', 'string', '', true );
1988@@ -37,12 +37,14 @@
1989 }
1990 }
1991
1992-$sql = "SELECT T_users.*, grp_ID, grp_name, COUNT(blog_ID) AS nb_blogs
1993- FROM T_users RIGHT JOIN T_groups ON user_grp_ID = grp_ID
1994- LEFT JOIN T_blogs on user_ID = blog_owner_user_ID
1995- WHERE $where_clause 1
1996- GROUP BY user_ID, grp_ID
1997- ORDER BY grp_name, *";
1998+$sql = "SELECT T_users.*, grp_ID, grp_name,
1999+ COUNT(blog_ID) AS nb_blogs
2000+ FROM T_users
2001+ RIGHT JOIN T_groups ON user_grp_ID = grp_ID
2002+ LEFT JOIN T_blogs on user_ID = blog_owner_user_ID
2003+ WHERE $where_clause 1
2004+ GROUP BY user_ID, grp_ID
2005+ ORDER BY grp_name, *";
2006
2007 $count_sql = 'SELECT COUNT(*)
2008 FROM T_users
2009@@ -111,10 +113,20 @@
2010 'td' => '$user_firstname$ $user_lastname$',
2011 );
2012
2013+// User #1 can see all ...
2014+if( $current_User->ID === '1' )
2015+{
2016+ $Results->cols[] = array(
2017+ 'th' => T_('Email'),
2018+ 'td_class' => 'shrinkwrap',
2019+ 'td' => '%user_mailto( #user_email# )%',
2020+ );
2021+}
2022+
2023 $Results->cols[] = array(
2024- 'th' => T_('Email'),
2025+ 'th' => T_('Message'),
2026 'td_class' => 'shrinkwrap',
2027- 'td' => '%user_mailto( #user_email# )%',
2028+ 'td' => '%user_message( #user_allow_msgform#, #user_email# , #user_ID#, #user_nickname# )%',
2029 );
2030
2031 $Results->cols[] = array(
2032@@ -244,4 +256,19 @@
2033 return action_icon( T_('Email').': '.$email, 'email', 'mailto:'.$email, T_('Email') );
2034 }
2035
2036+/**
2037+ * dummy docblock
2038+ */
2039+function user_message( $allow_form, $email, $ID, $nickname )
2040+{
2041+ if( $allow_form === '0' )
2042+ {
2043+ return '&nbsp;';
2044+ }
2045+
2046+ $form_url = url_add_param( '', 'recipient_id='.$ID.'&amp;redirect_to='.rawurlencode( url_rel_to_same_host( regenerate_url( '', '', '', '&' ), '' ) ) );
2047+
2048+ return action_icon( sprintf( T_('Send email to %s'), $nickname ), 'email', $form_url );
2049+}
2050+
2051 ?>
2052
2053=== modified file 'qp_install/_create_items.php'
2054--- qp_install/_create_items.php 2013-03-22 21:28:25 +0000
2055+++ qp_install/_create_items.php 2013-04-18 18:37:26 +0000
2056@@ -132,7 +132,7 @@
2057 $edited_Item = new Item();
2058 $edited_Item->insert( 1, T_('artists-paint-pots-2'), 'This shows the simplest attachment possible: the file name became the file\'s title, alt text, description, and post title.', $now, $cat_yellowstone, array(), 'published','en-US' );
2059 // attach an image to the item
2060-$edit_File = new File( 'collection', 4, 'artists-paint-pots-2.jpg' );
2061+$edit_File = new File( 'blog', 4, 'artists-paint-pots-2.jpg' );
2062 $edit_File->link_to_Item( $edited_Item );
2063 // add meta data for this image (only once per image!)
2064 $query = "UPDATE T_files SET file_title = 'artists-paint-pots-2', file_alt = 'artists-paint-pots-2', file_desc = 'artists-paint-pots-2' WHERE file_ID = {$edit_File->ID}";
2065@@ -162,7 +162,7 @@
2066 $edited_Item = new Item();
2067 $edited_Item->insert( 1, T_('Photo of Biscuit Basin'), 'This shows a customized "file title" field, which became the alt text and description and item title.', $now, $cat_yellowstone, array(), 'published','en-US' );
2068 // attach an image to the item
2069-$edit_File = new File( 'collection', 4, 'biscuit-basin.jpg' );
2070+$edit_File = new File( 'blog', 4, 'biscuit-basin.jpg' );
2071 $edit_File->link_to_Item( $edited_Item );
2072 // add meta data for this image (only once per image!)
2073 $query = "UPDATE T_files SET file_title = 'Photo of Biscuit Basin', file_alt = 'Photo of Biscuit Basin', file_desc = 'Photo of Biscuit Basin' WHERE file_ID = {$edit_File->ID}";
2074@@ -212,7 +212,7 @@
2075 $edited_Item = new Item();
2076 $edited_Item->insert( 1, T_('Emerald Pool, Yellowstone NP'), 'This image has all three attributes set to unique values, then this post was created with a unique title and content, then the image was attached to the post.', $now, $cat_yellowstone, array(), 'published','en-US' );
2077 // attach an image to the item
2078-$edit_File = new File( 'collection', 4, 'emerald-pool-in-yellowstone.jpg' );
2079+$edit_File = new File( 'blog', 4, 'emerald-pool-in-yellowstone.jpg' );
2080 $edit_File->link_to_Item( $edited_Item );
2081 // add meta data for this image (only once per image!)
2082 $query = "UPDATE T_files SET file_title = 'Emerald Pool, Yellowstone', file_alt = 'Photo of Emerald Pool in Yellowstone', file_desc = 'This is the \"description/caption\" field for the file name \"emerald-pool-in-yellowstone.jpg\"' WHERE file_ID = {$edit_File->ID}";
2083@@ -258,7 +258,7 @@
2084 $edited_Item = new Item();
2085 $edited_Item->insert( 1, T_('Mammoth Hot Springs'), '', $now, $cat_yellowstone, array(), 'published','en-US' );
2086 // attach an image to the item
2087-$edit_File = new File( 'collection', 4, 'mammoth-hot-springs.jpg' );
2088+$edit_File = new File( 'blog', 4, 'mammoth-hot-springs.jpg' );
2089 $edit_File->link_to_Item( $edited_Item );
2090 // add meta data for this image (only once per image!)
2091 $query = "UPDATE T_files SET file_title = 'Mammoth Hot Springs', file_alt = 'Mammoth Hot Springs', file_desc = 'Free Stock Photo of Mammoth Hot Springs - Yellowstone - Travel, from public-domain-photos.com' WHERE file_ID = {$edit_File->ID}";
2092@@ -317,7 +317,7 @@
2093 $edited_Item = new Item();
2094 $edited_Item->insert( 1, T_('Morning Glory Pool'), 'This photo has some text like a normal blog post might.', $now, $cat_yellowstone, array(), 'published','en-US' );
2095 // attach an image to the item
2096-$edit_File = new File( 'collection', 4, 'morning-glory-pool.jpg' );
2097+$edit_File = new File( 'blog', 4, 'morning-glory-pool.jpg' );
2098 $edit_File->link_to_Item( $edited_Item );
2099 // add meta data for this image (only once per image!)
2100 $query = "UPDATE T_files SET file_title = 'Morning Glory Pool', file_alt = 'Morning Glory Pool', file_desc = 'Free Stock Photo of Morning Glory Pool - Yellowstone - Travel, from public-domain-photos.com' WHERE file_ID = {$edit_File->ID}";
2101@@ -362,13 +362,13 @@
2102 $edited_Item = new Item();
2103 $edited_Item->insert( 1, T_('2 pics in one post'), 'This post shows how you can attach more than one image to a post. All of the Yellowstone photos came from <a href="http://www.public-domain-photos.com/travel/yellowstone">Public-Domain-Photos</a>.', $now, $cat_yellowstone, array(), 'published','en-US' );
2104 // attach an image to the item
2105-$edit_File = new File( 'collection', 4, 'mammoth-hot-springs.jpg' );
2106+$edit_File = new File( 'blog', 4, 'mammoth-hot-springs.jpg' );
2107 $edit_File->link_to_Item( $edited_Item );
2108 // add meta data for this image (only once per image!)
2109 $query = "UPDATE T_files SET file_title = 'Mammoth Hot Springs', file_alt = 'Mammoth Hot Springs', file_desc = 'Mammoth Hot Springs.' WHERE file_ID = {$edit_File->ID}";
2110 $DB->query( $query );
2111 // attach another image to the item
2112-$edit_File = new File( 'collection', 4, 'morning-glory-pool.jpg' );
2113+$edit_File = new File( 'blog', 4, 'morning-glory-pool.jpg' );
2114 $edit_File->link_to_Item( $edited_Item );
2115 // add meta data for this image (only once per image!)
2116 $query = "UPDATE T_files SET file_title = 'Morning Glory Pool', file_alt = 'Morning Glory Pool', file_desc = 'Morning Glory Pool.' WHERE file_ID = {$edit_File->ID}";
2117@@ -551,7 +551,7 @@
2118
2119 Image used compliments of <a href="http://www.flickr.com/photos/leeturner/sets/72157622986782395/with/4278672768/" title="inserted image sample" target="_blank">Lee Turner</a>'), $now, $cat_appname );
2120 // attach an image to the item
2121-$edit_File = new File( 'collection', 2, 'waterfall.jpg' );
2122+$edit_File = new File( 'blog', 2, 'waterfall.jpg' );
2123 $edit_File->link_to_Item( $edited_Item );
2124 // add meta data for this image (only once per image!)
2125 $query = "UPDATE T_files SET file_title = 'waterfall', file_alt = 'waterfall', file_desc = 'waterfall' WHERE file_ID = {$edit_File->ID}";
2126@@ -573,7 +573,7 @@
2127
2128 Image used compliments of <a href="http://innervisions.org.uk/bimble/2008/08/sunshine-and-showers" title="attached image sample" target="_blank">Yabs</a>'), $now, $cat_appname );
2129 // attach an image to the item
2130-$edit_File = new File( 'collection', 2, 'sunshine_and_flowers.jpeg' );
2131+$edit_File = new File( 'blog', 2, 'sunshine_and_flowers.jpeg' );
2132 $edit_File->link_to_Item( $edited_Item );
2133 // add meta data for this image (do once per default image!)
2134 $query = "UPDATE T_files SET file_title = 'Coral Jupiter', file_alt = 'home grown flowers', file_desc = 'Coral Jupiter - home grown flowers (caption/description field)' WHERE file_ID = {$edit_File->ID}";
2135
2136=== modified file 'qp_install/_functions_dbupgrade.php'
2137--- qp_install/_functions_dbupgrade.php 2013-03-22 21:28:25 +0000
2138+++ qp_install/_functions_dbupgrade.php 2013-04-18 18:37:26 +0000
2139@@ -873,6 +873,303 @@
2140 else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2141 }
2142
2143+ if( $cur_db_version < 44 )
2144+ {
2145+ $cur_db_version++;
2146+ echo 'Renaming the bloggroups table to blog_groups ... ';
2147+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."bloggroups RENAME TO ".$app_db_tableprefix."blog_groups" ) !== false )
2148+ {
2149+ set_upgrade_checkpoint( $cur_db_version );
2150+ }
2151+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2152+ }
2153+
2154+ if( $cur_db_version < 45 )
2155+ {
2156+ $cur_db_version++;
2157+ echo 'Renaming the coll_settings table to blog_settings ... ';
2158+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."coll_settings RENAME TO ".$app_db_tableprefix."blog_settings" ) !== false )
2159+ {
2160+ set_upgrade_checkpoint( $cur_db_version );
2161+ }
2162+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2163+ }
2164+
2165+ if( $cur_db_version < 46 )
2166+ {
2167+ $cur_db_version++;
2168+ echo 'Renaming the blogusers table to blog_users ... ';
2169+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."blogusers RENAME TO ".$app_db_tableprefix."blog_users" ) !== false )
2170+ {
2171+ set_upgrade_checkpoint( $cur_db_version );
2172+ }
2173+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2174+ }
2175+
2176+ if( $cur_db_version < 47 )
2177+ {
2178+ $cur_db_version++;
2179+ echo 'Renaming the cron__log table to cron_log ... ';
2180+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."cron__log RENAME TO ".$app_db_tableprefix."cron_log" ) !== false )
2181+ {
2182+ set_upgrade_checkpoint( $cur_db_version );
2183+ }
2184+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2185+ }
2186+
2187+ if( $cur_db_version < 48 )
2188+ {
2189+ $cur_db_version++;
2190+ echo 'Renaming the cron__task table to cron_task ... ';
2191+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."cron__task RENAME TO ".$app_db_tableprefix."cron_task" ) !== false )
2192+ {
2193+ set_upgrade_checkpoint( $cur_db_version );
2194+ }
2195+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2196+ }
2197+
2198+ if( $cur_db_version < 49 )
2199+ {
2200+ $cur_db_version++;
2201+ echo 'Renaming the items__item table to items ... ';
2202+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__item RENAME TO ".$app_db_tableprefix."items" ) !== false )
2203+ {
2204+ set_upgrade_checkpoint( $cur_db_version );
2205+ }
2206+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2207+ }
2208+
2209+ if( $cur_db_version < 50 )
2210+ {
2211+ $cur_db_version++;
2212+ echo 'Renaming the postcats table to item_cats ... ';
2213+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."postcats RENAME TO ".$app_db_tableprefix."item_cats" ) !== false )
2214+ {
2215+ set_upgrade_checkpoint( $cur_db_version );
2216+ }
2217+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2218+ }
2219+
2220+ if( $cur_db_version < 51 )
2221+ {
2222+ $cur_db_version++;
2223+ echo 'Renaming the items__prerendering table to item_prerendering ... ';
2224+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__prerendering RENAME TO ".$app_db_tableprefix."item_prerendering" ) !== false )
2225+ {
2226+ set_upgrade_checkpoint( $cur_db_version );
2227+ }
2228+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2229+ }
2230+
2231+ if( $cur_db_version < 52 )
2232+ {
2233+ $cur_db_version++;
2234+ echo 'Renaming the items__status table to item_status ... ';
2235+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__status RENAME TO ".$app_db_tableprefix."item_status" ) !== false )
2236+ {
2237+ set_upgrade_checkpoint( $cur_db_version );
2238+ }
2239+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2240+ }
2241+
2242+ if( $cur_db_version < 53 )
2243+ {
2244+ $cur_db_version++;
2245+ echo 'Renaming the items__itemtag table to item_tags ... ';
2246+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__itemtag RENAME TO ".$app_db_tableprefix."item_tags" ) !== false )
2247+ {
2248+ set_upgrade_checkpoint( $cur_db_version );
2249+ }
2250+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2251+ }
2252+
2253+ if( $cur_db_version < 54 )
2254+ {
2255+ $cur_db_version++;
2256+ echo 'Renaming the items__type table to item_types ... ';
2257+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__type RENAME TO ".$app_db_tableprefix."item_types" ) !== false )
2258+ {
2259+ set_upgrade_checkpoint( $cur_db_version );
2260+ }
2261+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2262+ }
2263+
2264+ if( $cur_db_version < 55 )
2265+ {
2266+ $cur_db_version++;
2267+ echo 'Renaming the items__version table to item_versions ... ';
2268+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__version RENAME TO ".$app_db_tableprefix."item_versions" ) !== false )
2269+ {
2270+ set_upgrade_checkpoint( $cur_db_version );
2271+ }
2272+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2273+ }
2274+
2275+ if( $cur_db_version < 56 )
2276+ {
2277+ $cur_db_version++;
2278+ echo 'Renaming the pluginevents table to plugin_events ... ';
2279+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."pluginevents RENAME TO ".$app_db_tableprefix."plugin_events" ) !== false )
2280+ {
2281+ set_upgrade_checkpoint( $cur_db_version );
2282+ }
2283+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2284+ }
2285+
2286+ if( $cur_db_version < 57 )
2287+ {
2288+ $cur_db_version++;
2289+ echo 'Renaming the pluginsettings table to plugin_settings ... ';
2290+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."pluginsettings RENAME TO ".$app_db_tableprefix."plugin_settings" ) !== false )
2291+ {
2292+ set_upgrade_checkpoint( $cur_db_version );
2293+ }
2294+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2295+ }
2296+
2297+ if( $cur_db_version < 58 )
2298+ {
2299+ $cur_db_version++;
2300+ echo 'Renaming the pluginusersettings table to plugin_usersettings ... ';
2301+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."pluginusersettings RENAME TO ".$app_db_tableprefix."plugin_usersettings" ) !== false )
2302+ {
2303+ set_upgrade_checkpoint( $cur_db_version );
2304+ }
2305+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2306+ }
2307+
2308+ if( $cur_db_version < 59 )
2309+ {
2310+ $cur_db_version++;
2311+ echo 'Renaming the items__tag table to tags ... ';
2312+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."items__tag RENAME TO ".$app_db_tableprefix."tags" ) !== false )
2313+ {
2314+ set_upgrade_checkpoint( $cur_db_version );
2315+ }
2316+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2317+ }
2318+
2319+ if( $cur_db_version < 60 )
2320+ {
2321+ $cur_db_version++;
2322+ echo 'Renaming the templates__template table to templates ... ';
2323+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."templates__template RENAME TO ".$app_db_tableprefix."templates" ) !== false )
2324+ {
2325+ set_upgrade_checkpoint( $cur_db_version );
2326+ }
2327+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2328+ }
2329+
2330+ if( $cur_db_version < 61 )
2331+ {
2332+ $cur_db_version++;
2333+ echo 'Renaming the templates__container table to template_containers ... ';
2334+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."templates__container RENAME TO ".$app_db_tableprefix."template_containers" ) !== false )
2335+ {
2336+ set_upgrade_checkpoint( $cur_db_version );
2337+ }
2338+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2339+ }
2340+
2341+ if( $cur_db_version < 62 )
2342+ {
2343+ $cur_db_version++;
2344+ echo 'Renaming the usersettings table to user_settings ... ';
2345+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."usersettings RENAME TO ".$app_db_tableprefix."user_settings" ) !== false )
2346+ {
2347+ set_upgrade_checkpoint( $cur_db_version );
2348+ }
2349+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2350+ }
2351+
2352+ if( $cur_db_version < 63 )
2353+ {
2354+ $cur_db_version++;
2355+ echo 'Renaming the widget table to widgets ... ';
2356+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."widget RENAME TO ".$app_db_tableprefix."widgets" ) !== false )
2357+ {
2358+ set_upgrade_checkpoint( $cur_db_version );
2359+ }
2360+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2361+ }
2362+
2363+ if( $cur_db_version < 64 )
2364+ {
2365+ $cur_db_version++;
2366+ echo 'Renaming the track__keyphrase table to keyphrases ... ';
2367+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."track__keyphrase RENAME TO ".$app_db_tableprefix."keyphrases" ) !== false )
2368+ {
2369+ set_upgrade_checkpoint( $cur_db_version );
2370+ }
2371+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2372+ }
2373+
2374+ if( $cur_db_version < 65 )
2375+ {
2376+ $cur_db_version++;
2377+ echo 'Renaming the track__goal table to goals ... ';
2378+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."track__goal RENAME TO ".$app_db_tableprefix."goals" ) !== false )
2379+ {
2380+ set_upgrade_checkpoint( $cur_db_version );
2381+ }
2382+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2383+ }
2384+
2385+ if( $cur_db_version < 66 )
2386+ {
2387+ $cur_db_version++;
2388+ echo 'Renaming the track__goalhit table to goal_hits ... ';
2389+ if( $DB->query( "ALTER TABLE ".$app_db_tableprefix."track__goalhit RENAME TO ".$app_db_tableprefix."goal_hits" ) !== false )
2390+ {
2391+ set_upgrade_checkpoint( $cur_db_version );
2392+ }
2393+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2394+ }
2395+
2396+ if( $cur_db_version < 67 )
2397+ {
2398+ $cur_db_version++;
2399+ echo 'Removing ptyp_ID = 1600 from item_types table ... ';
2400+ if( $DB->query( "DELETE FROM ".$app_db_tableprefix."item_types WHERE ptyp_ID = 1600" ) !== false )
2401+ {
2402+ set_upgrade_checkpoint( $cur_db_version );
2403+ }
2404+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2405+ }
2406+
2407+ if( $cur_db_version < 68 )
2408+ {
2409+ $cur_db_version++;
2410+ echo 'Modifying file_root_type in the files table ... ';
2411+ if( db_mod_col( $app_db_tableprefix."files", "file_root_type", "ENUM('absolute','user','blog','shared','templates','collection') NOT NULL DEFAULT 'absolute'" ) !== false )
2412+ {
2413+ set_upgrade_checkpoint( $cur_db_version );
2414+ }
2415+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2416+ }
2417+
2418+ if( $cur_db_version < 69 )
2419+ {
2420+ $cur_db_version++;
2421+ echo 'Updating file_root_type in the files table ... ';
2422+ if( $DB->query( "UPDATE ".$app_db_tableprefix."files SET template_type = REPLACE( file_root_type, 'collection', 'blog' )" ) !== false )
2423+ {
2424+ set_upgrade_checkpoint( $cur_db_version );
2425+ }
2426+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2427+ }
2428+
2429+ if( $cur_db_version < 70 )
2430+ {
2431+ $cur_db_version++;
2432+ echo 'Modifying file_root_type in the files table ... ';
2433+ if( db_mod_col( $app_db_tableprefix."files", "file_root_type", "ENUM('absolute','user','blog','shared','templates') NOT NULL DEFAULT 'absolute'" ) !== false )
2434+ {
2435+ set_upgrade_checkpoint( $cur_db_version );
2436+ }
2437+ else debug_die( T_('Upgrader crashed doing step# ').$cur_db_version );
2438+ }
2439+
2440 // -----------------------------------------------------------------------------------------
2441 // Remember changing the DB schema, too! Check out these files:
2442 // - qp_inc/_core/model/__core.install.php
2443
2444=== modified file 'qp_plugins/smilies_plugin/_smilies.plugin.php'
2445--- qp_plugins/smilies_plugin/_smilies.plugin.php 2013-03-22 21:28:25 +0000
2446+++ qp_plugins/smilies_plugin/_smilies.plugin.php 2013-04-18 18:37:26 +0000
2447@@ -172,7 +172,12 @@
2448 */
2449 function DisplayCommentToolbar( & $params )
2450 {
2451- if( ( $this->Settings->get( 'render_comments' ) ) || ( is_logged_in() && $this->UserSettings->get( 'use_toolbar' ) ) )
2452+ $user_wants_toolbar = false;
2453+ if( is_logged_in() && ! is_null( $this->UserSettings ) )
2454+ {
2455+ $user_wants_toolbar = $this->UserSettings->get( 'use_toolbar' );
2456+ }
2457+ if( ( $this->Settings->get( 'render_comments' ) ) || $user_wants_toolbar )
2458 {
2459 return $this->make_the_toolbar( $params );
2460 }
2461
2462=== modified file 'qp_srvc/profile_update.php'
2463--- qp_srvc/profile_update.php 2013-03-22 21:28:25 +0000
2464+++ qp_srvc/profile_update.php 2013-04-18 18:37:26 +0000
2465@@ -88,7 +88,10 @@
2466
2467 $current_User->set( 'firstname', $newuser_firstname );
2468 $current_User->set( 'lastname', $newuser_lastname );
2469-$current_User->set( 'nickname', $newuser_nickname );
2470+if( ! $lock_id_and_nick )
2471+{
2472+ $current_User->set( 'nickname', $newuser_nickname );
2473+}
2474 $current_User->set_email( $newuser_email );
2475 $current_User->set( 'url', $newuser_url );
2476 $current_User->set( 'idmode', $newuser_idmode );
2477
2478=== modified file 'qp_srvc/register.php'
2479--- qp_srvc/register.php 2013-03-22 21:28:25 +0000
2480+++ qp_srvc/register.php 2013-04-18 18:37:26 +0000
2481@@ -67,6 +67,7 @@
2482 ) );
2483
2484 // all logins to be lowercase to guarantee uniqueness regardless of the database case handling for UNIQUE indexes
2485+ $login_raw = $login;
2486 $login = strtolower( $login );
2487
2488 $UserCache = & get_Cache( 'UserCache' );
2489@@ -86,7 +87,7 @@
2490 $new_User = new User();
2491 $new_User->set( 'login', $login );
2492 $new_User->set( 'pass', md5( $pass1 ) ); // encrypted
2493- $new_User->set( 'nickname', $login );
2494+ $new_User->set( 'nickname', $login_raw );
2495 $new_User->set_email( $email );
2496 $new_User->set( 'ip', $Hit->IP );
2497 $new_User->set( 'domain', $Hit->get_remote_host( true ) );

Subscribers

People subscribed via source and target branches