Example #1
0
function groups_from_members_init()
{
    global $CONFIG;
    add_group_tool_option('members_invite', elgg_echo('groupsfrommembers:members-invite'), false);
    if (get_plugin_setting('maxusers') == 0) {
        set_plugin_setting('maxusers', 20);
    }
    register_plugin_hook('permissions_check', 'group', 'groups_from_members_member_can_invite');
    register_elgg_event_handler('pagesetup', 'system', 'groups_from_members_submenus');
    register_plugin_hook('action', 'groups/invite', 'groups_from_members_member_invited_action');
    register_action('groupsfrommembers/search', false, $CONFIG->pluginspath . 'groupsfrommembers/actions/search.php');
}
<?php

/**
 * Elgg profile plugin edit default profile action
 * 
 * @package ElggProfile
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd <*****@*****.**>
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 */
// Load configuration
global $CONFIG;
action_gatekeeper();
admin_gatekeeper();
$n = 0;
while (get_plugin_setting("admin_defined_profile_{$n}", 'profile')) {
    set_plugin_setting("admin_defined_profile_{$n}", '', 'profile');
    set_plugin_setting("admin_defined_profile_type_{$n}", '', 'profile');
    $n++;
}
system_message(elgg_echo('profile:defaultprofile:reset'));
forward($_SERVER['HTTP_REFERER']);
<?php

/**
 * Elgg profile plugin edit default profile action removal
 * 
 * @package ElggProfile
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd <*****@*****.**>
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 */
global $CONFIG;
action_gatekeeper();
admin_gatekeeper();
$id = (int) get_input('id');
if ($id && set_plugin_setting("admin_defined_profile_{$id}", '', 'profile') && set_plugin_setting("admin_defined_profile_type_{$id}", '', 'profile')) {
    system_message(elgg_echo('profile:editdefault:delete:success'));
} else {
    register_error(elgg_echo('profile:editdefault:delete:fail'));
}
forward($_SERVER['HTTP_REFERER']);
<?php

/**
 * Elgg profile plugin edit default profile action
 *
 * @package ElggProfile
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd <*****@*****.**>
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.com/
 */
// Load configuration
global $CONFIG;
admin_gatekeeper();
$n = 0;
while (get_plugin_setting("admin_defined_profile_{$n}", 'profile')) {
    set_plugin_setting("admin_defined_profile_{$n}", '', 'profile');
    set_plugin_setting("admin_defined_profile_type_{$n}", '', 'profile');
    $n++;
}
set_plugin_setting('user_defined_fields', FALSE, 'profile');
system_message(elgg_echo('profile:defaultprofile:reset'));
forward($_SERVER['HTTP_REFERER']);
Example #5
0
<?php

/**
 * Elgg profile plugin edit default profile action
 *
 * @package ElggProfile
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd <*****@*****.**>
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.com/
 */
global $CONFIG;
admin_gatekeeper();
$label = sanitise_string(get_input('label'));
$type = sanitise_string(get_input('type'));
if ($label && $type) {
    // find next index for new field
    $n = 0;
    while (get_plugin_setting("admin_defined_profile_{$n}", 'profile')) {
        $n++;
    }
    if (set_plugin_setting("admin_defined_profile_{$n}", $label, 'profile') && set_plugin_setting("admin_defined_profile_type_{$n}", $type, 'profile')) {
        system_message(elgg_echo('profile:editdefault:success'));
    } else {
        register_error(elgg_echo('profile:editdefault:fail'));
    }
} else {
    register_error(elgg_echo('profile:editdefault:fail'));
}
forward($_SERVER['HTTP_REFERER']);
Example #6
0
$local_version = get_plugin_setting('version', 'community_plugins');
if ($version <= $local_version) {
    register_error('No upgrade required');
    forward(REFERER);
}
$base_dir = $CONFIG->pluginspath . 'community_plugins/upgrades';
// taken from engine/lib/version.php
if ($handle = opendir($base_dir)) {
    $upgrades = array();
    while ($updatefile = readdir($handle)) {
        // Look for upgrades and add to upgrades list
        if (!is_dir("{$base_dir}/{$updatefile}")) {
            if (preg_match('/^([0-9]{10})\\.(php)$/', $updatefile, $matches)) {
                $plugin_version = (int) $matches[1];
                if ($plugin_version > $local_version) {
                    $upgrades[] = "{$base_dir}/{$updatefile}";
                }
            }
        }
    }
    // Sort and execute
    asort($upgrades);
    if (sizeof($upgrades) > 0) {
        foreach ($upgrades as $upgrade) {
            include $upgrade;
        }
    }
}
set_plugin_setting('version', $version, 'community_plugins');
system_message("The community plugin repository has been upgraded");
forward(REFERER);
Example #7
0
function westorElggMan_set_plugin_setting($name, $value, $plugin_id = null)
{
    if (function_exists("elgg_set_plugin_setting")) {
        return elgg_set_plugin_setting($name, $value, $plugin_id);
    } else {
        return set_plugin_setting($name, $value, $plugin_id);
    }
}
Example #8
0
<?php

/**
 * Uncaptcha
 * 
 * @package Uncaptcha
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Brett Profitt
 * @copyright Brett Profitt 2008
 * @link http://eschoolconsultants.com
 */
/**
 * Default Settings
 */
if (!get_plugin_setting('trick_field_name', 'uncaptcha')) {
    set_plugin_setting('trick_field_name', 'email_address', 'uncaptcha');
}
$enable_selected = get_plugin_setting('instant_enable', 'uncaptcha') ? 'checked="checked"' : '';
$login_after_selected = get_plugin_setting('login_after', 'uncaptcha') ? 'checked="checked"' : '';
$trick_field_name = get_plugin_setting('trick_field_name', 'uncaptcha');
$validate_form = elgg_view('input/pulldown', array('internalname' => 'params[instant_validate]', 'value' => get_plugin_setting('instant_validate', 'uncaptcha'), 'options_values' => array(1 => elgg_echo('option:yes'), 0 => elgg_echo('option:no'))));
$login_after_form = elgg_view('input/pulldown', array('internalname' => 'params[login_after]', 'value' => get_plugin_setting('login_after', 'uncaptcha'), 'options_values' => array(1 => elgg_echo('option:yes'), 0 => elgg_echo('option:no'))));
$enable_form = elgg_view('input/pulldown', array('internalname' => 'params[instant_enable]', 'value' => get_plugin_setting('instant_enable', 'uncaptcha'), 'options_values' => array(1 => elgg_echo('option:yes'), 0 => elgg_echo('option:no'))));
$register_success_foward_form = elgg_view('input/pulldown', array('internalname' => 'params[register_success_forward]', 'value' => get_plugin_setting('register_success_forward', 'uncaptcha'), 'options_values' => array('' => elgg_echo('uncaptcha:settings:forward_dashboard'), 'mod/profile/edit.php' => elgg_echo('uncaptcha:settings:forward_profile_edit'), 'mod/profile/editicon.php' => elgg_echo('uncaptcha:settings:forward_profile_editicon'), '*user_profile*' => elgg_echo('uncaptcha:settings:forward_user_profile'), 'pg/settings' => elgg_echo('uncaptcha:settings:forward_user_settings'))));
// @todo.  Add some JS to makes the login_after only appear when both enable and validate are selected.
?>
<p>
<?php 
echo elgg_echo('uncaptcha:settings:blurb');
?>
</p>
<?php

/**
 * Save Userpoints settings
 * 
 */
global $CONFIG;
gatekeeper();
action_gatekeeper();
// Params array (text boxes and drop downs)
$params = get_input('params');
foreach ($params as $k => $v) {
    if (!set_plugin_setting($k, $v, 'fivestar')) {
        register_error(sprintf(elgg_echo('plugins:settings:save:fail'), 'fivestar'));
        forward($_SERVER['HTTP_REFERER']);
    }
}
if (is_array(get_input('change_vote'))) {
    set_plugin_setting('change_vote', 1, 'fivestar');
} else {
    set_plugin_setting('change_vote', 0, 'fivestar');
}
$view = '';
foreach ($_POST['views'] as $value) {
    $view .= $value . "\n";
}
set_plugin_setting('view', $view, 'fivestar');
//set_plugin_setting('view', 0, 'fivestar');
system_message(elgg_echo('fivestar:settings:save:ok'));
forward($_SERVER['HTTP_REFERER']);
 * @author Aaron Saray (102degrees.com)
 * @author Cash Costello
 */
set_plugin_setting('enablefirephp', get_input('enablefirephp'), 'elgg_developer_tools');
set_plugin_setting('displayerrors', get_input('displayerrors'), 'elgg_developer_tools');
set_plugin_setting('errorhandler', get_input('errorhandler'), 'elgg_developer_tools');
set_plugin_setting('exceptionhandler', get_input('exceptionhandler'), 'elgg_developer_tools');
set_plugin_setting('errorlog', get_input('errorlog'), 'elgg_developer_tools');
set_plugin_setting('htmllog', get_input('htmllog'), 'elgg_developer_tools');
if (get_input('usesimplecache')) {
    elgg_view_enable_simplecache();
} else {
    elgg_view_disable_simplecache();
}
if (get_input('useviewscache')) {
    elgg_enable_filepath_cache();
} else {
    elgg_disable_filepath_cache();
}
$debug_trace_level = get_input('debug');
if ($debug_trace_level == 'OFF') {
    unset_config('debug');
} else {
    set_config('debug', $debug_trace_level);
}
set_plugin_setting('timing', get_input('timing'), 'elgg_developer_tools');
set_plugin_setting('showviews', get_input('showviews'), 'elgg_developer_tools');
set_plugin_setting('showstrings', get_input('showstrings'), 'elgg_developer_tools');
set_plugin_setting('logevents', get_input('logevents'), 'elgg_developer_tools');
system_message(elgg_echo("elgg_dev_tools:message:successfulupdate"));
forward($CONFIG->wwwroot . 'pg/elgg_dev_tools/');
function siteaccess_get_email($type)
{
    $update = false;
    switch ($type) {
        case 'admin_activated':
            $setting = 'admin_activated_email';
            $email_guid = get_plugin_setting($setting, 'siteaccess');
            $subject = elgg_echo('siteaccess:email:adminactivated:subject');
            $content = elgg_echo('siteaccess:email:adminactivated:content');
            break;
        case 'confirm':
            $setting = 'confirm_email';
            $email_guid = get_plugin_setting($setting, 'siteaccess');
            $subject = elgg_echo('siteaccess:email:confirm:subject');
            $content = elgg_echo('siteaccess:email:confirm:content');
            break;
        case 'validated':
            $setting = 'validated_email';
            $email_guid = get_plugin_setting($setting, 'siteaccess');
            $subject = elgg_echo('siteaccess:email:validated:subject');
            $content = elgg_echo('siteaccess:email:validated:content');
            break;
        case 'notify_admin':
            $setting = 'notify_admin_email';
            $email_guid = get_plugin_setting($setting, 'siteaccess');
            $subject = elgg_echo('siteaccess:email:notifyadmin:subject');
            $content = elgg_echo('siteaccess:email:notifyadmin:content');
            break;
    }
    if ($email_guid) {
        $email = get_entity($email_guid);
        if (!$email) {
            $update = true;
            $email = siteaccess_new_email($subject, $content);
        }
    } else {
        if ($setting) {
            // if setting is set then a valid optino was selected create email
            $update = true;
            $email = siteaccess_new_email($subject, $content);
        }
    }
    if ($update && $email && isadminloggedin()) {
        $email->save();
        set_plugin_setting($setting, $email->guid, 'siteaccess');
    }
    if ($email) {
        return $email;
    }
    return false;
}
Example #12
0
<?php

/**
 * Elgg plugin settings save action.
 * 
 * @package Elgg
 * @subpackage Core
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.org/
 */
$params = get_input('params');
$plugin = get_input('plugin');
gatekeeper();
action_gatekeeper();
$result = false;
foreach ($params as $k => $v) {
    // Save
    $result = set_plugin_setting($k, $v, $plugin);
    // Error?
    if (!$result) {
        register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin));
        forward($_SERVER['HTTP_REFERER']);
        exit;
    }
}
// An event to tell any interested plugins of the change is settings
//trigger_elgg_event('plugin_settings_save', $plugin, find_plugin_settings($plugin)); // replaced by plugin:setting event
system_message(sprintf(elgg_echo('plugins:settings:save:ok'), $plugin));
forward($_SERVER['HTTP_REFERER']);
Example #13
0
function oauth_processing()
{
    // create the consumer
    $consument = oauth_create_consumer('cclite-test', 'cclite test elgg-oauth consumer', '123123', '123123');
    set_plugin_setting('oauthconsumer', $consument->getGUID());
}
Example #14
0
/**
 * sets or gets the private settings for the izap_videos
 *
 * @param string $settingName setting name
 * @param mix $values sting or array of value
 * @param boolean $override if we want to force override the value
 * @param boolean $makeArray if we want the return value in the array
 * @return value array or string
 */
function izapAdminSettings_izap_videos($settingName, $values = '', $override = false, $makeArray = false)
{
    // get the old value
    $oldSetting = get_plugin_setting($settingName, 'izap_videos');
    if (is_array($values)) {
        $pluginValues = implode('|', $values);
    } else {
        $pluginValues = $values;
    }
    // if it is not set yet
    if (empty($oldSetting) || $override) {
        if (!set_plugin_setting($settingName, $pluginValues, 'izap_videos')) {
            return FALSE;
        }
    }
    if ($oldSetting) {
        $oldArray = explode('|', $oldSetting);
        if (count($oldArray) > 1) {
            $returnVal = $oldArray;
        } else {
            $returnVal = $oldSetting;
        }
    } else {
        $returnVal = $values;
    }
    if (!is_array($returnVal) && $makeArray) {
        $newReturnVal[] = $returnVal;
        $returnVal = $newReturnVal;
    }
    return $returnVal;
}
/**
 * Set default settings
 * 
 */
function fivestar_settings()
{
    // Set plugin defaults
    if (!(int) get_plugin_setting('stars')) {
        set_plugin_setting('stars', '5');
    }
    $change_vote = (int) get_plugin_setting('change_vote');
    if ($change_vote == 0) {
        set_plugin_setting('change_cancel', 0);
    } else {
        set_plugin_setting('change_cancel', 1);
    }
    if (!get_plugin_setting('style')) {
        set_plugin_setting('style', 'basic');
    }
    if (!get_plugin_setting('view')) {
        $view = 'view=object/blog, tag=div, attribute=class, attribute_value=contentWrapper singleview, before_html=<br />
view=object/image, tag=div, attribute=id, attribute_value=tidypics_wrapper
view=object/groupforumtopic, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=object/poll, tag=div, attribute=class, attribute_value=contentWrapper singleview, before_html=<br /><br />
view=poll/listing, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=object/page_top, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=pages/pageprofile, tag=div, attribute=class, attribute_value=contentWrapper, before_html=<br />
view=object/file, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=object/file, tag=div, attribute=class, attribute_value=filerepo_controls';
        set_plugin_setting('view', $view);
    }
    if (get_plugin_setting('view') == 'object/blog|div|class|contentWrapper singleview, object/image|div|calss|tidypics_info') {
        $view = 'view=object/blog, tag=div, attribute=class, attribute_value=contentWrapper singleview, before_html=<br />
view=object/image, tag=div, attribute=id, attribute_value=tidypics_wrapper
view=object/groupforumtopic, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=forum/topicposts, tag=div, attribute=class, attribute_value=topic_post
view=object/poll, tag=div, attribute=class, attribute_value=contentWrapper singleview, before_html=<br /><br />
view=poll/listing, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=object/page_top, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=pages/pageprofile, tag=div, attribute=class, attribute_value=contentWrapper, before_html=<br />
view=object/file, tag=div, attribute=class, attribute_value=search_listing, before_html=<br />
view=object/file, tag=div, attribute=class, attribute_value=filerepo_controls';
        set_plugin_setting('view', $view);
    }
}