[geeklog-cvs] geeklog-1.3/system lib-plugins.php,1.14,1.15
dhaun at geeklog.net
dhaun at geeklog.net
Sun Feb 23 09:57:14 EST 2003
Update of /usr/cvs/geeklog/geeklog-1.3/system
In directory internal.geeklog.net:/tmp/cvs-serv1180/system
Modified Files:
lib-plugins.php
Log Message:
Added support for new plugin functions plugin_user_create_<pluginname> and plugin_user_delete_<pluginname> to help plugins manage additional user-related tables (e.g. extended user information).
Index: lib-plugins.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/system/lib-plugins.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** lib-plugins.php 14 Feb 2003 04:36:32 -0000 1.14
--- lib-plugins.php 23 Feb 2003 14:57:12 -0000 1.15
***************
*** 588,590 ****
--- 588,632 ----
}
+ /**
+ * This function will inform all plugins when a new user account is created.
+ *
+ * @param int $uid user id of the new user account
+ *
+ */
+ function PLG_createUser ($uid)
+ {
+ global $_TABLES;
+
+ $result = DB_query ("SELECT pi_name FROM {$_TABLES['plugins']} WHERE pi_enabled = 1");
+ $nrows = DB_numRows ($result);
+ for ($i = 1; $i <= $nrows; $i++) {
+ $A = DB_fetchArray ($result);
+ $function = 'plugin_user_create_' . $A['pi_name'];
+ if (function_exists ($function)) {
+ $function ($uid);
+ }
+ }
+ }
+
+ /**
+ * This function will inform all plugins when a user account is deleted.
+ *
+ * @param int $uid user id of the deleted user account
+ *
+ */
+ function PLG_deleteUser ($uid)
+ {
+ global $_TABLES;
+
+ $result = DB_query ("SELECT pi_name FROM {$_TABLES['plugins']} WHERE pi_enabled = 1");
+ $nrows = DB_numRows ($result);
+ for ($i = 1; $i <= $nrows; $i++) {
+ $A = DB_fetchArray ($result);
+ $function = 'plugin_user_delete_' . $A['pi_name'];
+ if (function_exists ($function)) {
+ $function ($uid);
+ }
+ }
+ }
+
?>
More information about the geeklog-cvs
mailing list