[geeklog-cvs] geeklog-1.3/system lib-plugins.php,1.37,1.38
dhaun at iowaoutdoors.org
dhaun at iowaoutdoors.org
Sun Sep 19 13:56:01 EDT 2004
Update of /var/cvs/geeklog-1.3/system
In directory www:/tmp/cvs-serv28132/system
Modified Files:
lib-plugins.php
Log Message:
Added to plugin API functions to inform plugins about users logging in and out (TBD: need to handle "auto-login" in case a valid cookie still exists).
Index: lib-plugins.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/lib-plugins.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** lib-plugins.php 16 Sep 2004 19:11:14 -0000 1.37
--- lib-plugins.php 19 Sep 2004 17:55:59 -0000 1.38
***************
*** 684,687 ****
--- 684,725 ----
/**
+ * This function will inform all plugins when a user logs in
+ *
+ * @param int $uid user id
+ *
+ */
+ function PLG_loginUser ($uid)
+ {
+ global $_TABLES, $_PLUGINS;
+
+ foreach ($_PLUGINS as $pi_name) {
+ $function = 'plugin_user_login_' . $pi_name;
+ if (function_exists ($function)) {
+ $function ($uid);
+ }
+ }
+ }
+
+ /**
+ * This function will inform all plugins when a user logs out.
+ * Plugins should not rely on this ever being called, as the user may simply
+ * close the browser instead of logging out.
+ *
+ * @param int $uid user id
+ *
+ */
+ function PLG_logoutUser ($uid)
+ {
+ global $_TABLES, $_PLUGINS;
+
+ foreach ($_PLUGINS as $pi_name) {
+ $function = 'plugin_user_logout_' . $pi_name;
+ if (function_exists ($function)) {
+ $function ($uid);
+ }
+ }
+ }
+
+ /**
* Geeklog is about to display the edit form for the user's profile. Plugins
* now get a chance to add their own variables and input fields to the form.
More information about the geeklog-cvs
mailing list