' . __('Fatal G2 error:', 'wpg2') . '' . $ret;
exit;
}
}
// Remove the g2_user cap
if($_GET['duser_id'] != "" && $_GET['dg2user_id'] == "") {
$usercap = new WP_User($_GET['duser_id']);
if ($usercap->has_cap('gallery2_user')) {
?>
add_cap('gallery2_user', false);
g2_delete_user($_GET['duser_id']);
}
}
// add the g2_user cap
if($_GET['auser_id'] != "" && $_GET['ag2user_id'] == "" ) {
$usercap = new WP_User($_GET['auser_id']);
if (!$usercap->has_cap('gallery2_user')) {
$usercap->add_cap('gallery2_user', true);
?>has_cap('gallery2_admin')) {
?>add_cap('gallery2_admin', false);
}
}
// Add the g2_admin cap
if($_GET['auser_id'] != "" && $_GET['ag2user_id'] != "" ) {
$usercap = new WP_User($_GET['auser_id']);
if (!$usercap->has_cap('gallery2_admin')) {
$usercap->add_cap('gallery2_admin', true);
?> $g2user['externalId'], 'entityType' => 'GalleryUser'));
}
}
}
// Get a List of all current WP Users
$wpusers = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY ID");
$cnt = 0;
foreach ($wpusers as $wpuser) {
$wparray[$cnt] = $wpuser->ID;
$cnt++;
g2_create_user($wpuser->ID);
g2_admin_user($wpuser->ID);
}
// Get G2 Mapping
list ($ret, $g2users) = GalleryEmbed::getExternalIdMap('entityId');
if ($ret) {
echo __('Fatal G2 error:', 'wpg2') . $ret->getAsHtml();
exit;
}
foreach ($g2users as $g2user) {
if ( $g2user['entityType'] == "GalleryUser" ) {
$ret = GalleryCoreApi::removeMapEntry( 'ExternalIdMap', array('externalId' => $g2array[$entity], 'entityType' => 'GalleryUser'));
$g2entityarray[$g2user['externalId']] = $g2user['entityId'];
}
}
echo '';
echo '
'. __('Help', 'wpg2').'
';
echo '
' . __('Manage Mapped Gallery2 <> Wordpress Users', 'wpg2') . '
';
echo '
' . __('This page is for controlling the Gallery2 capabilities that are associated with each user.', 'wpg2') . '
';
// Wordpress Accounts Mapped to G2
$output = '
';
$output = '
';
// Wordpress Accounts Not mapped to G2
$output = '
';
echo '
';
$ret = GalleryEmbed::done();
?>