/** * LDAP authentication * * @param mixed $credentials PAM handler specific credentials * @return boolean */ function ldap_auth_authenticate($credentials = null) { // Nothing to do if LDAP module not installed if (!function_exists('ldap_connect')) { return false; } // Get configuration settings $config = find_plugin_settings('ldap_auth'); // Nothing to do if not configured if (!$config) { return false; } $username = admin; $password = pass; if (is_array($credentials) && $credentials['username'] && $credentials['password']) { $username = $credentials['username']; $password = $credentials['password']; } else { return false; } // Perform the authentication return ldap_auth_check($config, $username, $password); }
<?php /** * Google Maps plugin for the Elgg social network engine. */ $settings = find_plugin_settings('google-map'); $key = $settings->api_key; if (DOMAIN == 'alice.com') { $key = 'ABQIAAAATmXYGjIxcoW0PZTT8B5-yxS9gD-IG-XY9TtpNzaYqj1O2EUssBQLVLDAdqta9MoaHyhBNbPVTJh1PQ'; } echo "<script src='http://maps.google.com/maps?file=api&v=2&key={$key}' type-='text/javascript'></script>"; echo "<script type='text/javascript'>"; include $CONFIG->pluginspath . '/google-map/js/gmap.php'; echo "var IMAGES='{$CONFIG->url}mod/google-map/images/';"; echo "</script>";
?> ]</a><?php } ?> </h3> <?php if (elgg_view("settings/{$plugin}/edit")) { ?> <div class="pluginsettings"> <div id="<?php echo $plugin; ?> _settings"> <?php echo elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_settings($plugin))); ?> </div> </div> <?php } ?> <?php if ($manifest) { ?> <div class="plugin_description"><?php echo elgg_view('output/longtext', array('value' => $manifest['description'])); ?> </div> <?php
/** * Clear a plugin setting. * * @param string $name The name. * @param string $plugin_name Optional plugin name, if not specified then it is detected from where you are calling from. */ function clear_plugin_setting($name, $plugin_name = "") { $plugin = find_plugin_settings($plugin_name); if ($plugin) { return remove_all_private_settings($plugin->guid); } //$plugin->clearMetaData($name); return false; }
else $(this).parent().addClass('fivestar-collapsed').find("legend").addClass('fivestar-collapsed'); }); }); }); }; $(document).ready(function() { $("fieldset.fivestar-collapsible").collapse(); }); </script> <?php $plugin = find_plugin_settings('fivestar'); $form = "<br />" . elgg_echo('fivestar:numstars'); $form .= elgg_view('input/pulldown', array('internalname' => 'params[stars]', 'options_values' => array('2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10'), 'value' => $plugin->stars)); $form .= "<br><br>"; $form .= '<p class="admin_debug">'; $form .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('fivestar:settings:change_cancel') => 1), 'internalname' => 'change_vote', 'value' => $plugin->change_vote)); $form .= "</p>"; $form .= '<br /><h4>' . elgg_echo('fivestar:settings:view_heading') . ':</h4><br />'; $x = 1; $lines = explode("\n", get_plugin_setting('view', 'fivestar')); foreach ($lines as $line) { $options = array(); $parms = explode(",", $line); foreach ($parms as $parameter) { preg_match("/^(\\S+)=(.*)\$/", trim($parameter), $match); $options[$match[1]] = $match[2];
<?php /** * iZAP izap_videos * * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ action_gatekeeper(); admin_gatekeeper(); $postedArray = get_input('izap'); $plugin = find_plugin_settings('izap_videos'); // get the video options checkboxes $videoOptions = filter_tags($_POST['izap']['izapVideoOptions']); if (empty($videoOptions)) { register_error(elgg_echo('izap_videos:error:videoOptionBlank')); forward($_SERVER['HTTP_REFERER']); } $postedArray['izapVideoOptions'] = $videoOptions; // get the index page widget if (!empty($postedArray['izapExtendVideoSupport'])) { $postedArray['izapExtendVideoSupport'] = 'YES'; } else { $postedArray['izapExtendVideoSupport'] = 'NO'; } // get the index page widget if (!empty($postedArray['izapIndexPageWidget'])) {
<?php ini_set('display_errors', '1'); // Elgg obliterates the &ticket query paramter; we need // to reinstate it from the $vals variable. //$_REQUEST['ticket'] = $vals[1]; global $CONFIG, $messages, $vars; require_once dirname(dirname(dirname(__FILE__))) . '/lib/lib.php'; // get module configuration $config = find_plugin_settings('cas_auth'); $NetUsername = authCAS($config); // get user details out of LDAP. //$attr = cas_ldapSearch($NetUsername); $casUser = cas_mysqlSearch($NetUsername); if (!empty($casUser->username)) { $username = $casUser->username; } else { $username = $NetUsername; } //$username = empty($username) ? $username : str_replace(".", "",$username); $user = get_user_by_username($username); if (!$user) { $user_guid = cas_insertUser($username, $casUser, $config); $user = get_user_by_username($username); $result = cas_do_login($user, false); } else { $result = cas_do_login($user, false); } if ($result) { system_message(elgg_echo('loginok')); if ($_SESSION['last_forward_from']) {
<?php /** * Elgg vazco_topbar plugin * * @author Michal Zacher [michal.zacher@gmail.com] * @website www.elggdev.com */ $linklist = get_plugin_setting('linklist', 'vazco_topbar'); $settings = find_plugin_settings('vazco_topbar'); if (!$settings->loginbar || $settings->loginbox == "no") { $settings->loginbar = "yes"; } if (!$settings->loginbox) { $settings->loginbox = "yes"; } if (!$settings->joinicontools) { $settings->joinicontools = "yes"; } if (!$settings->elgglogo) { $settings->elgglogo = "yes"; } if (!$settings->joinsettings) { $settings->joinsettings = "yes"; } ?> <div class="contentWrapper"> <form action="<?php echo $vars['url']; ?> action/vazco_topbar/edit" method="post">
/** * connects to ldap server * * Tries connect to specified ldap server. * Returns connection result or error. * * @return connection result */ function cas_ldapConnect($binddn = '', $bindpwd = '') { global $CONFIG, $messages; $config = find_plugin_settings('cas_auth'); //Select bind password, With empty values use //ldap_bind_* variables or anonymous bind if ldap_bind_* are empty if ($binddn == '' and $bindpwd == '') { if (!empty($config->ldap_bind_dn)) { $binddn = $config->ldap_bind_dn; } if (!empty($config->ldap_bind_pwd)) { $bindpwd = $config->ldap_bind_pwd; } } if (!isset($config->ldaphostname)) { $messages[] = __gettext("\\LDAP server information has not been provided. Aborting now!"); return false; } $server = trim($config->ldaphostname); if (!$server) { $messages[] = __gettext("\\LDAP server information has not been provided. Aborting now!"); return false; } $ldapport = 389; if (!empty($config->ldapport)) { $ldapport = $config->ldapport; } $connresult = ldap_connect($server, $ldapport); //ldap_connect returns ALWAYS true if (!empty($config->ldapversion)) { ldap_set_option($connresult, LDAP_OPT_PROTOCOL_VERSION, $config->ldapversion); } if (!empty($binddn)) { //bind with search-user //$debuginfo .= 'Using bind user'.$binddn.'and password:'******'{$server}'<br /> Bind result: '" . ldap_error($connresult) . "' <br />"; //If any of servers are alive we have already returned connection $messages[] = "LDAP-module cannot connect to LDAP server : {$debuginfo}"; return false; }
/** * Clear all plugin settings. * * @param string $plugin_name Optional plugin name, if not specified then it is detected from where you are calling from. */ function clear_all_plugin_settings($plugin_name = "") { $plugin = find_plugin_settings($plugin_name); if ($plugin) { return remove_all_private_settings($plugin->guid); } return FALSE; }
<?php /** * river_comments * * @author Pedro Prez * @link http://community.elgg.org/pg/profile/pedroprez * @copyright (c) Keetup 2010 * @link http://www.keetup.com/ * @license GNU General Public License (GPL) version 2 */ // Get the Elgg engine require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php"; set_context('admin'); admin_gatekeeper(); $plugin = find_plugin_settings('river_comments'); $form_body = elgg_view('settings/river_comments/edit', array('entity' => $plugin)); //$submit_button = elgg_view('input/submit', array('value' => elgg_echo('save'))); $form_body .= "<p>" . elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => 'river_comments')) . $submit_button . "</p>"; $content = elgg_view('input/form', array('action' => "{$CONFIG->url}action/plugins/settings/save", 'body' => $form_body)); $content = "<div class='contentWrapper'>{$content}</div>"; $title = elgg_echo('river_comments:admin'); $body = elgg_view_layout('two_column_left_sidebar', '', elgg_view_title($title) . $content); page_draw($title, $body);