# Boston, MA 02111-1307  USA
#
# $Id: profileext_manage.php,v 1.6 2005/04/18 15:33:34 filetreefrog Exp $
##################################################
// Part of the User Management category
if (!defined('PATHOS')) {
    exit('');
}
if (pathos_permissions_check('user_management', pathos_core_makeLocation('administrationmodule'))) {
    if (!defined('SYS_USERS')) {
        require_once BASE . 'subsystems/users.php';
    }
    pathos_users_includeProfileExtensions();
    pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION);
    $template = new template('administrationmodule', '_profileextManager', $loc);
    pathos_users_clearDeletedExtensions();
    // This will clear db of deleted exts.
    $exts = $db->selectObjects('profileextension');
    if (!defined('SYS_SORTING')) {
        require_once BASE . 'subsystems/sorting.php';
    }
    usort($exts, 'pathos_sorting_byRankAscending');
    for ($i = 0; $i < count($exts); $i++) {
        $exts[$i]->name = call_user_func(array($exts[$i]->extension, 'name'));
        $exts[$i]->author = call_user_func(array($exts[$i]->extension, 'author'));
        $exts[$i]->description = call_user_func(array($exts[$i]->extension, 'description'));
    }
    $unused = pathos_users_listUnusedExtensions();
    foreach ($unused as $i) {
        $unused[$i] = null;
        $unused[$i]->name = call_user_func(array($i, 'name'));
示例#2
0
function pathos_users_saveProfileExtensions($formvalues, $user, $is_new)
{
    // Pull in form data for all active profile extensions.
    // First, we have to clear delete extensions, so that we don't try to include
    // or use previously active extensions that have been disabled.
    pathos_users_clearDeletedExtensions();
    // Include all class files for active profile extensions.
    pathos_users_includeProfileExtensions();
    // Pull in the database object from the global scope.
    global $db;
    // Read in all of the active profile extensions and sort them (which may actually be
    // unnecessary.)
    $exts = $db->selectObjects('profileextension');
    usort($exts, 'pathos_sorting_byRankAscending');
    foreach ($exts as $ext) {
        // Call the saveProfile method of each profile extension class, which will return the modified user object.
        $user = call_user_func(array($ext->extension, 'saveProfile'), $formvalues, $user, $is_new);
    }
    // Return the full user object to the caller.
    return $user;
}