Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tneumann9/PlanetRed
  • JSTUREK8/PlanetRed
  • smccoy12/PlanetRed
  • dkuzelka2/PlanetRed
  • s-cwiedel5/PlanetRed
  • dxg/PlanetRed
6 results
Show changes
Commits on Source (568)
Showing
with 31347 additions and 1592 deletions
# To use this script, you must have the following variables defined
# You can define them at the project or the group level
#
# SONAR_URL: Full URL to the SonarQube server
# SONAR_TOKEN: API token for SonarQube
stages:
- Security
- QA
Dependency Check:
stage: Security
image: its-registry.unl.edu/unl-its/docker-ci/dependency-check
tags:
- docker
cache:
policy: push
paths:
- dep_check
script:
- dependency-check -noupdate -f JSON -f XML -f HTML -s . -o ./dep_check --project "$CI_PROJECT_TITLE" --enableExperimental
SonarQube:
stage: QA
image: its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:php
tags:
- docker
only:
- master
cache:
policy: pull
paths:
- dep_check
script:
- sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_TOKEN
-Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.projectName="$CI_PROJECT_TITLE"
-Dsonar.sources=.
-Dsonar.dependencyCheck.reportPath=./dep_check/dependency-check-report.xml
-Dsonar.dependencyCheck.jsonReportPath=./dep_check/dependency-check-report.json
-Dsonar.dependencyCheck.htmlReportPath=./dep_check/dependency-check-report.html
******** ********
** How to set up UNL_Elgg: ** How to set up UNL_Elgg:
******** ********
Navigate to the elgg/mod directory in Terminal and sym-link to cas_auth and unl_theme Run the setup.sh script to symlink all the necessary plugins
ln -s ../../cas_auth cas_auth ./setup.sh
ln -s ../../unl_theme unl_theme Create a mysql database named unl_social
Create a database named unl_social
Import the full_dump.sql file* Import the full_dump.sql file*
mysql -u root unl_social < stable_dump.sql mysql -u root unl_social < full_dump.sql
Browse to the elgg directory in your web browser. Browse to the elgg directory in your web browser and do elgg's installation:
Create the local elgg/.htaccess file using the sample on the install page Create the local elgg/.htaccess file using the sample on the install page
Be sure to set the correct RewriteBase /~bbieber/UNL_Elgg/elgg/ for example. Be sure to set the correct RewriteBase /workspace/UNL_Elgg/elgg/ for example.
Create the local elgg/engine/settings.php file. Create the local elgg/engine/settings.php file.
Be sure to specify unl_social as the database name Be sure to specify unl_social as the database name
Create a local directory for elgg data outside of the web root. Add this settings file to your svn:ignore list
Create a local directory named elgg_data for elgg to write to outside of the web root.
Change the permissions so Apache has write access to it. Change the permissions so Apache has write access to it.
sudo chown _www elgg_data sudo chown _www elgg_data
Install the UNL_Templates pear packages Install pear http://pear.php.net/manual/en/installation.getting.php
pear channel-discover pear.unl.edu && pear install unl/UNL_Templates-beta Install the UNL_Templates pear packages
Set the correct site url within the database: pear channel-discover pear.unl.edu && pear install unl/UNL_Templates-beta unl/UNL_Services_Peoplefinder-beta DB
UPDATE elggsites_entity SET url='http://localhost/~bbieber/UNL_Elgg/elgg/' WHERE guid=1; Set the correct site url within the unl_social database:
UPDATE elggdatalists SET value = '/Library/WebServer/Documents/workspace/UNL_Elgg/elgg/' WHERE name = 'path'; UPDATE elggsites_entity SET url='http://ucommbieber.unl.edu/workspace/UNL_Elgg/elgg/' WHERE guid=1;
UPDATE elggdatalists SET value = '/Library/WebServer/Documents/workspace/elgg_data/' WHERE name = 'dataroot'; UPDATE elggdatalists SET value = '/Users/bbieber/Documents/workspace/UNL_Elgg/elgg/' WHERE name = 'path';
Make sure the local site has an updated copy of the templatedependents UPDATE elggdatalists SET value = '/Users/bbieber/Documents/workspace/UNL_Elgg/elgg_data/' WHERE name = 'dataroot';
Make sure the local site has an updated copy of the unl templatedependents
******
** Troubleshooting
******
After navigating to the elgg dir in your browser and filling in the correct database info -
if you get the error that elgg can't connect to your database do this:
1. find your php.ini file, probably located at /etc/php.ini.default and rename it to php.ini
2. edit the mysql.default_socket line to include the path to your mysql.sock file, e.g.
mysql.default_socket = /private/tmp/mysql.sock
If the mobile site or the regular site starts pulling in the Absolute template rather than the specified template
you may need to set up a symbolic link for the wdn directory. The UNL_Templates package will
>> cd elgg/
>> ln -s /var/www/html/wdn wdn
******* *******
** Notes on importing data: ** Notes on importing data:
******* *******
****From here on out we will be dumping data from the live server to import on testing instances only. Changes on test
instances that modify database fields must be documented and repeated on the live server after testing.
full_dump.sql is is full copy of the mysql database that must be modified upon import. full_dump.sql is is full copy of the mysql database that must be modified upon import.
safe_dump.sql can be imported without the need for modification safe_dump.sql can be imported without the need for modification
...@@ -35,9 +52,74 @@ when importing full_dump.sql, you must modify certain rows in the tables elggdat ...@@ -35,9 +52,74 @@ when importing full_dump.sql, you must modify certain rows in the tables elggdat
that they pertain to the local elgg site instance. (so if you see something like that they pertain to the local elgg site instance. (so if you see something like
http://ucommjuhl.unl.edu/UNL_Elgg/elgg, change it!) http://ucommjuhl.unl.edu/UNL_Elgg/elgg, change it!)
*******
** Notes on importing data for dev to local machine:
*******
-On 'live' machine: ftp a copy of the database to your machine
scp /backups/mysql/daily/unl_social/unl_social_2010-04-22_00h10m.Thursday.sql.gz usernameonlocalmachine@yourmachine.com:/Path/To/Transer/To
-On 'dev' machine: unzip it
gunzip unl_social_2010-04-22_00h10m.Thursday.sql.gz
-import it
mysql -u username -p < /Path/To/unl_social_2010-04-22_00h10m.Thursday.sql
-Set the correct site url within the unl_social database:
mysql -u username -p
use unl_social;
UPDATE elggsites_entity SET url='http://ucommmeranda.unl.edu/workspace/UNL_Elgg/elgg/' WHERE guid=1;
UPDATE elggdatalists SET value = '/Users/smeranda/Documents/workspace/UNL_Elgg/elgg/' WHERE name = 'path';
UPDATE elggdatalists SET value = '/Users/smeranda/Documents/workspace/UNL_Elgg/elgg_data/' WHERE name = 'dataroot';
-zip up elgg_data and ftp that
zip -r newfilename elgg_data
-replace your local copy of elgg_data with this one and make sure apache (could be _www or apache or ?) has write access to it
cd path/to/elgg_data
sudo chown -R _www *
*******
** Plugin info
*******
Just run the setup.sh script. If any plugins are added, add this to the setup.sh script.
******* *******
** Changes made to the Elgg engine for UNL's implementation (changes made inside the elgg directory) ** Patches
******* *******
-Altered /elgg/engine/lib/users.php to bar registration of accounts starting with "unl_" All patches are located in the /pathces directory. These include:
\ No newline at end of file patches/check_page_owner_exists.diff * check that $page_owner is set or a non-existant profile returns 500 error (FIXED IN 1.7.4)
patches/relationship_get_set_public.diff *__get __set not declared correctly
patches/lowercase_post.diff *Forms use POST which doesn't validate
patches/strip_tags_name_field.diff *Display Name field allowed html that often was not escaped upon output
patches/add_closing_labels.diff
*******
** Things to look out for when new versions of Elgg are released
*******
-- Look at elgg's upgrade readme and look for changes to .htaccess
-- Are there changes to /elgg/actions/login.php and /elgg/actions/logout.php ?????
We have overridden those actions with our own in the cas_auth_unl plugin
*******
** Previous svn:externals prior to moving to git
*******
elgg http://code.elgg.org/elgg/tags/1.7.3/
# Our plugins/modules
elgg/mod/flexprofile http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/flexprofile
elgg/mod/form http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/form
elgg/mod/globe http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/globe
elgg/mod/putyourselfonthemap http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/putyourselfonthemap
elgg/mod/mass_mailouts http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/mass_mailouts
elgg/mod/cas_auth_unl http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/cas_auth_unl
elgg/mod/customindex http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/customindex
elgg/mod/unl_theme http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/unl_theme
elgg/mod/riverfaces http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/riverfaces
elgg/mod/friend_request http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/friend_request
elgg/mod/mobile http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/mobile
elgg/mod/mobile_unl http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/mobile_unl
elgg/mod/tidypics http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/tidypics
elgg/mod/au_group_notifications http://gforge.unl.edu/svn/unl_elgg/trunk/plugins/au_group_notifications
# (pulling from another repository)
elgg/featured/ http://gforge.unl.edu/svn/unl_huskers/trunk/
<?php
/**
* Elgg CAS authentication
*
* @package cas_auth
* @license http://www.gnu.org/licenses/gpl.html
* @author Xavier Roussel <xavier.roussel@uvsq.fr>
* @copyright UVSQ 2008
* @link http://www.uvsq.fr
*/
// Include main cas lib
include_once 'cas/CAS.php';
$casInitialized = false;
/**
* CAS Authentication init
*
*/
function cas_auth_init()
{
// global config
global $CONFIG;
// plugin config
$config = find_plugin_settings('cas_auth');
// todo : send message to user
if (!$config) return false;
// CAS auth required
if ( $_REQUEST['loginwith'] == 'UNLlogin' && !isset($_REQUEST['ticket']) )
{
createCas();
}
// CAS auth done
if ( $_REQUEST['loginwith'] == 'UNLlogin' && isset($_REQUEST['ticket']) )
{
// Check CAS auth the CAS way just in case
if ( checkCas() ) {
$_SESSION['loggedWithCAS'] = true;
$uname = getUserCas();
var_dump($uname);
if(ldapAuthenticate( getUserCas() )) {
system_message(elgg_echo('loginok'));
}
else register_error(elgg_echo('loginerror'));
}
}
// The CAS ticket is lost, log out
if ( $_SESSION['loggedWithCAS'] && !checkCas() ) {
$_SESSION['loggedWithCAS'] = false;
forward($CONFIG->url.'/action/logout');
}
}
// Register the initialisation function
register_elgg_event_handler('init','system','cas_auth_init');
// Register CAS logout to main logout only if user logged with CAS
if ( $_SESSION['loggedWithCAS'] ) {
register_elgg_event_handler('logout', 'user', 'logoutCas');
}
/**
* CAS client initialization
*
*/
function initCas() {
if (!$GLOBALS[casInitialized]) {
$config = find_plugin_settings('cas_auth');
phpCAS::client(CAS_VERSION_2_0, $config->casurl, (int) $config->casport , $config->casuri );
$GLOBALS[casInitialized] = true;
}
}
/**
* Force authentication
*
*/
function createCas() {
initCas();
phpCAS::forceAuthentication();
}
/**
* Check auth
*
* @return boolean
*/
function checkCas() {
initCas();
if (phpCAS::checkAuthentication()) {
return true;
}
else return false;
}
/**
* Get CAS user
*
* @return string name of the user
*/
function getUserCas() {
return phpCAS::getUser();
}
/**
* CAS logout
*
*/
function logoutCas() {
global $CONFIG;
initCas();
phpCAS::logout($CONFIG->url.'/action/logout');
}
/**
* LDAP authentication
*
* @param string $username Go around PAM handler credentials (CAS can't return a password)
* @return boolean
*/
function ldapAuthenticate($username)
{
// 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;
}
if (empty($username)) {
return false;
}
// Perform the authentication
return ldapCheck($config, $username);
}
/**
* Perform an LDAP authentication check
*
* @param ElggPlugin $config
* @param string $username
* @return boolean
*/
function ldapCheck($config, $username)
{
$host = $config->hostname;
// No point continuing
if(empty($host))
{
error_log("LDAP error: no host configured.");
return;
}
$port = $config->port;
$version = $config->version;
$basedn = $config->basedn;
$filter_attr = $config->filter_attr;
$search_attr = $config->search_attr;
$bind_dn = $config->ldap_bind_dn;
$bind_pwd = $config->ldap_bind_pwd;
$user_create = $config->user_create;
$start_tls = $config->start_tls;
($user_create == 'on') ? $user_create = true : $user_create = false;
($start_tls == 'on') ? $start_tls = true : $start_tls = false;
$port ? $port : $port = 389;
$version ? $version : $version = 3;
$filter_attr ? $filter_attr : $filter_attr = 'uid';
$basedn ? $basedn = array_map('trim', explode(':', $basedn)) : $basedn = array();
if (!empty($search_attr))
{
// $search_attr as in "email:email_address, name:name_name";
$pairs = array_map('trim',explode(',', $search_attr));
$values = array();
foreach ($pairs as $pair)
{
$parts = array_map('trim', explode(':', $pair));
$values[$parts[0]] = $parts[1];
}
$search_attr = $values;
}
else
{
$search_attr = array('dn' => 'dn');
}
// Create a connection
if ($ds = ldapConnect($host, $port, $version, $bind_dn, $bind_pwd))
{
if ($start_tls and !ldap_start_tls($ds)) return false;
// Perform a search
foreach ($basedn as $this_ldap_basedn)
{
$ldap_user_info = ldapDoAuth($ds, $this_ldap_basedn, $username, $filter_attr, $search_attr);
if($ldap_user_info)
{
// LDAP login successful
if ($user = get_user_by_username($username))
{
// User exists, login
return login($user);
}
else
{
// Valid login but user doesn't exist
if ($user_create)
{
$name = $ldap_user_info['firstname'];
if (isset($ldap_user_info['lastname']))
{
$name = $name . " " . $ldap_user_info['lastname'];
}
($ldap_user_info['mail']) ? $email = $ldap_user_info['mail'] : $email = null;
if ($user_guid = register_user($username, 'generic', $name, $email))
{
// Success, credentials valid and account has been created
return login(get_user($user_guid));
}
else
{
register_error(elgg_echo('ldap_auth:no_register'));
return false;
}
}
else
{
register_error(elgg_echo("ldap_auth:no_account"));
return false;
}
}
}
}
// Close the connection
ldap_close($ds);
return false;
}
else
{
return false;
}
}
/**
* Create an LDAP connection
*
* @param string $host
* @param int $port
* @param int $version
* @param string $bind_dn
* @param string $bind_pwd
* @return mixed LDAP link identifier on success, or false on error
*/
function ldapConnect($host, $port, $version, $bind_dn, $bind_pwd)
{
$ds = @ldap_connect($host, $port);
@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version);
// Start the LDAP bind process
$ldapbind = null;
if ($ds)
{
if ($bind_dn != '')
{
$ldapbind = @ldap_bind($ds, $bind_dn, $bind_pwd);
}
else
{
// Anonymous bind
$ldapbind = @ldap_bind($ds);
}
}
else
{
// Unable to connect
error_log('Unable to connect to the LDAP server: '.ldap_error($ds));
return false;
}
if (!$ldapbind)
{
error_log('Unable to bind to the LDAP server with provided credentials: '.ldap_error($ds));
ldap_close($ds);
return false;
}
return $ds;
}
/**
* Performs actual LDAP authentication
*
* @param object $ds LDAP link identifier
* @param string $basedn
* @param string $username
* @param string $filter_attr
* @param string $search_attr
* @return mixed array with search attributes or false on error
*/
function ldapDoAuth($ds, $basedn, $username, $filter_attr, $search_attr)
{
$sr = @ldap_search($ds, $basedn, $filter_attr ."=". $username, array_values($search_attr));
if(!$sr)
{
error_log('Unable to perform LDAP search: '.ldap_error($ds));
return false;
}
$entry = ldap_get_entries($ds, $sr);
if(!$entry or !$entry[0])
{
return false; // didn't find username
}
// We have a bind, a valid login
foreach (array_keys($search_attr) as $attr)
{
$ldap_user_info[$attr] = $entry[0][$search_attr[$attr]][0];
}
return $ldap_user_info;
}
?>
\ No newline at end of file
<?php
/**
* Elgg CAS authentication
*
* @package cas_auth
* @license http://www.gnu.org/licenses/gpl.html
* @author Xavier Roussel <xavier.roussel@uvsq.fr>
* @copyright UVSQ 2008
* @link http://www.uvsq.fr
*/
require_once 'UNL/Services/Peoplefinder.php';
//In order to avoid a "__PHP_Incomplete_Class" problem when we unserialize the Peoplefinder data we need to set up the class here
//http://us2.php.net/manual/en/function.unserialize.php
class UNL_Peoplefinder_Record {
public $cn;
public $ou;
public $eduPersonNickname;
public $eduPersonPrimaryAffiliation;
public $givenName;
public $displayName;
public $mail;
public $postalAddress;
public $sn;
public $telephoneNumber;
public $title;
public $uid;
public $unlHRPrimaryDepartment;
public $unlHRAddress;
public $unlSISClassLevel;
public $unlSISCollege;
public $unlSISLocalAddr1;
public $unlSISLocalAddr2;
public $unlSISLocalCity;
public $unlSISLocalPhone;
public $unlSISLocalState;
public $unlSISLocalZip;
public $unlSISPermAddr1;
public $unlSISPermAddr2;
public $unlSISPermCity;
public $unlSISPermState;
public $unlSISPermZip;
public $unlSISMajor;
public $unlEmailAlias;
}
// Include main cas lib
include_once 'cas/CAS.php';
$casInitialized = false;
/**
* CAS Authentication init
*
*/
function cas_auth_init()
{
// global config
global $CONFIG;
// plugin config
$config = find_plugin_settings('cas_auth');
// todo : send message to user
if (!$config) return false;
// CAS auth required
if ( $_REQUEST['loginwith'] == 'UNLlogin' && !isset($_REQUEST['ticket']) )
{
createCas();
}
// CAS auth done
if ( $_REQUEST['loginwith'] == 'UNLlogin' && (isset($_REQUEST['ticket']) || isset($_REQUEST['email'])) )
{
// Check CAS auth the CAS way just in case
if ( checkCas() ) {
$_SESSION['loggedWithCAS'] = true;
$cas_user = getUserCas();
if(ldapAuthenticate( $cas_user )) {
system_message(elgg_echo('loginok'));
forward("pg/profile/unl_" . $cas_user);
}
else register_error(elgg_echo('loginerror'));
}
else register_error(elgg_echo('loginerror'));
}
// The CAS ticket is lost, log out
if ( $_SESSION['loggedWithCAS'] && !checkCas() ) {
$_SESSION['loggedWithCAS'] = false;
forward($CONFIG->url.'/action/logout');
}
}
global $CONFIG;
register_action("cas_auth/getemail",true,$CONFIG->pluginspath . "cas_auth/views/default/actions/getemail.php");
// Register the initialisation function
register_elgg_event_handler('init','system','cas_auth_init');
// Register CAS logout to main logout only if user logged with CAS
if ( $_SESSION['loggedWithCAS'] ) {
register_elgg_event_handler('logout', 'user', 'logoutCas');
}
/**
* CAS client initialization
*
*/
function initCas() {
if (!$GLOBALS[casInitialized]) {
$config = find_plugin_settings('cas_auth');
phpCAS::client(CAS_VERSION_2_0, $config->casurl, (int) $config->casport , $config->casuri );
$GLOBALS[casInitialized] = true;
}
}
/**
* Force authentication
*
*/
function createCas() {
initCas();
phpCAS::forceAuthentication();
}
/**
* Check auth
*
* @return boolean
*/
function checkCas() {
initCas();
if (phpCAS::checkAuthentication()) {
return true;
}
else return false;
}
/**
* Get CAS user
*
* @return string name of the user
*/
function getUserCas() {
return phpCAS::getUser();
}
/**
* CAS logout
*
*/
function logoutCas() {
global $CONFIG;
initCas();
phpCAS::logout($CONFIG->url.'/action/logout');
}
/**
* LDAP authentication
*
* @param string $username Go around PAM handler credentials (CAS can't return a password)
* @return boolean
*/
function ldapAuthenticate($username)
{
// 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;
// }
if (empty($username)) {
return false;
}
// Perform the authentication
return ldapCheck(/*$config, */$username);
}
/**
* Perform an LDAP authentication check
*
* @param ElggPlugin $config
* @param string $username
* @return boolean
*/
function ldapCheck(/*$config, */$username)
{
/* $host = $config->hostname;
// No point continuing
if(empty($host))
{
error_log("LDAP error: no host configured.");
return;
}
$port = $config->port;
$version = $config->version;
$basedn = $config->basedn;
$filter_attr = $config->filter_attr;
$search_attr = $config->search_attr;
$bind_dn = $config->ldap_bind_dn;
$bind_pwd = $config->ldap_bind_pwd;
$user_create = $config->user_create;
$start_tls = $config->start_tls;
($user_create == 'on') ? $user_create = true : $user_create = false;
($start_tls == 'on') ? $start_tls = true : $start_tls = false;
$port ? $port : $port = 389;
$version ? $version : $version = 3;
$filter_attr ? $filter_attr : $filter_attr = 'uid';
$basedn ? $basedn = array_map('trim', explode(':', $basedn)) : $basedn = array();
if (!empty($search_attr))
{
// $search_attr as in "email:email_address, name:name_name";
$pairs = array_map('trim',explode(',', $search_attr));
$values = array();
foreach ($pairs as $pair)
{
$parts = array_map('trim', explode(':', $pair));
$values[$parts[0]] = $parts[1];
}
$search_attr = $values;
}
else
{
$search_attr = array('dn' => 'dn');
}
*/
/* // Create a connection
if ($ds = ldapConnect($host, $port, $version, $bind_dn, $bind_pwd))
{
if ($start_tls and !ldap_start_tls($ds)) return false;
// Perform a search
foreach ($basedn as $this_ldap_basedn)
{
$ldap_user_info = ldapDoAuth($ds, $this_ldap_basedn, $username, $filter_attr, $search_attr);
if($ldap_user_info)
{
*/
$pf_user_info = peoplefinderServices($username);
//We're going to make every UNL SSO user have an elgg profile name as such: unl_erasmussen2
//and not allow friends of unl who register via elgg to pick names that begin with "unl_"
//This way, we won't have to deal with the case where someone registers erasmussen2 on elgg, then
//the real erasmussen2 signs in for the first time with UNL SSO and is logged in as the elgg user erasmussen2
//rather then having a new account created.
$username = 'unl_' . $username;
//Replace the hyphen in a student's name with an underscore
$username = str_replace('-','_',$username);
if ($user = get_user_by_username($username))
{
// User exists, login
return login($user);
}
else
{
// Valid login but user doesn't exist
//if ($user_create)
//{
// $name = $ldap_user_info['firstname'];
$name = $pf_user_info->displayName;
// if (isset($ldap_user_info['lastname']))
// {
// $name = $name . " " . $ldap_user_info['lastname'];
// }
//
/* if(!empty($pf_user_info->mail))
{
($pf_user_info->mail) ? $email = $pf_user_info->mail : $email = null;
}
else*/ if( isset($_REQUEST['email']) ){
$email = $_REQUEST['email'];
}
else
{
if($pf_user_info->mail)
forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php?e=' . $pf_user_info->mail);
else
forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php');
}
/* if ($user_guid = register_user($username, 'generic', $name, $email, false, 0, '', true))
{
// Success, credentials valid and account has been created
return login(get_user($user_guid));
}
else
{
register_error(elgg_echo("registerbad"));
return false;
}
*/
try {
if ($user_guid = register_user($username, 'generic', $name, $email, false, 0, '', true))
{
// Success, credentials valid and account has been created
return login(get_user($user_guid));
} else {
register_error(elgg_echo("registerbad"));
}
} catch (RegistrationException $r) {
register_error($r->getMessage());
}
//}
//else
//{
// register_error(elgg_echo("ldap_auth:no_account"));
// return false;
//}
}
/* }
}
// Close the connection
ldap_close($ds);
return false;
}
else
{
return false;
}
*/ }
/**
* Create an LDAP connection
*
* @param string $host
* @param int $port
* @param int $version
* @param string $bind_dn
* @param string $bind_pwd
* @return mixed LDAP link identifier on success, or false on error
*/
/* function ldapConnect($host, $port, $version, $bind_dn, $bind_pwd)
{
$ds = @ldap_connect($host, $port);
@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version);
// Start the LDAP bind process
$ldapbind = null;
if ($ds)
{
if ($bind_dn != '')
{
$ldapbind = @ldap_bind($ds, $bind_dn, $bind_pwd);
}
else
{
// Anonymous bind
$ldapbind = @ldap_bind($ds);
}
}
else
{
// Unable to connect
error_log('Unable to connect to the LDAP server: '.ldap_error($ds));
return false;
}
if (!$ldapbind)
{
error_log('Unable to bind to the LDAP server with provided credentials: '.ldap_error($ds));
ldap_close($ds);
return false;
}
return $ds;
}
*/
/**
* Performs actual LDAP authentication
*
* @param object $ds LDAP link identifier
* @param string $basedn
* @param string $username
* @param string $filter_attr
* @param string $search_attr
* @return mixed array with search attributes or false on error
*/
/* function ldapDoAuth($ds, $basedn, $username, $filter_attr, $search_attr)
{
$sr = @ldap_search($ds, $basedn, $filter_attr ."=". $username, array_values($search_attr));
if(!$sr)
{
error_log('Unable to perform LDAP search: '.ldap_error($ds));
return false;
}
$entry = ldap_get_entries($ds, $sr);
if(!$entry or !$entry[0])
{
return false; // didn't find username
}
// We have a bind, a valid login
foreach (array_keys($search_attr) as $attr)
{
$ldap_user_info[$attr] = $entry[0][$search_attr[$attr]][0];
}
return $ldap_user_info;
}
*/
/**
* Gets a UNL SSO user's info from Peoplefinder Services
*
* @param string $username
* @return array of information from PF Services
*/
function peoplefinderServices($username)
{
$pfrecord = unserialize(file_get_contents('http://peoplefinder.unl.edu/service.php?uid=' . $username . '&format=php'));
return $pfrecord;
}
?>
\ No newline at end of file
<?php
/**
* Elgg UNL SSO get email registration 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/
*/
// require_once(dirname(dirname(__FILE__)) . "/engine/start.php");
global $CONFIG;
// action_gatekeeper();
// Get variables
$email = get_input('email');
// var_dump($email);
$email = sanitise_string($email);
// var_dump($email);
if (is_email_address($email))
{
if (!get_user_by_email($email))
{
forward('?loginwith=UNLlogin&email=' . $email);
}
else
{
register_error(elgg_echo("Sorry, that email has already been registered. Please try again."));
}
}
else
{
register_error(elgg_echo("Sorry, that is not a complete email address. Please try again."));
}
$qs = explode('?',$_SERVER['HTTP_REFERER']);
$qs = $qs[0];
$qs .= "?e=" . urlencode($email);
forward($CONFIG->url . 'mod/cas_auth/views/default/account/getemail.php?e=' . urlencode($email));
?>
\ No newline at end of file
<?php
/**
* Elgg customindex plugin
* This plugin substitutes the frontpage with a custom one
*
* @package Customdash
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Boris Glumpler
* @copyright Boris Glumpler 2008
* @link /travel-junkie.com
*/
// Put your content below
?>
<!-- begin splash code from ucommcoleman/workspace/wdntempaltes/splash.shtml -->
<div id="splashwrapper">
<div id="splash">
<div id="headlines">
<div id="headline1" class="activepanel">
<div class="splash_headline">
<h4>Huskers Around the World</h4>
<p>
UNL community members are doing fantastic stuff around the world. Featured Huskers:
</p>
<!-- lat, lng, username, location, displayname, title, comment(text area), linkname(the username with the underscore) -->
<div class="member_icon">
<img id="shane" onclick="window.openLocationFeat('40.8','-96.7','demouser','Lincoln NE','Shane Farritor','Associate Professor, Mechanical Engineering','Shane Farritor, \'92, has conducted promising research on railcar derailment and surgical robots.','Shane_Farritor');return false;" src="mod/customindex/views/default/customindex/witw_icons/Shane_Farritor_tiny.jpg" alt="Profile Icon" />
</div>
<div class="member_icon">
<img onclick="window.openLocationFeat('-15.4081930','28.2871670','demouser','Zambia','Nithal Kuwa','Graduate student, Biological Sciences','Nithal Kuwa\'s research could impact more than 1.8 million children in sub-Saharan Africa.','Nithal_Kuwa');return false;" src="mod/customindex/views/default/customindex/witw_icons/Nithal_Kuwa_tiny.jpg" alt="Profile Icon" />
</div>
<div class="clear"></div>
Most recent members to join:
<!-- lat, lng, username, location, displayname, title, comment(text area) -->
<?php
$users = get_entities('user', '', 0, '', 8, 0, false, 0, null);
if($users){
foreach($users as $user){
//echo "<img src=\"http://ucommjuhl.unl.edu/UNL_Elgg/elgg/mod/profile/icondirect.php?username=" . $user->name . "&size=tiny\" />";
echo "<div class=\"member_icon\"><img onclick=\"window.openLocation('40.8','-96.7','" . $user->username . "','Lincoln NE','" . $user->name . "','Class of 1948');return false;\" src=\"/workspace/UNL_Elgg/elgg/mod/profile/icon.php?username=" . $user->username . "&size=tiny\" /></div>";
// echo "<div class=\"member_icon\">" . elgg_view("profile/icon",array('entity' => $user, 'size' => 'small')) . "</div>";
}
}
?>
</div>
</div>
<div id="headline2">
<div class="splash_headline">
<h4>Put Yourself On The Map</h4>
<p>
All University of Nebraska-Lincoln community members are encouraged to become part of the conversation. It's Huskers like you that are the <strong>Power of Red</strong>.
</p>
</div>
</div>
<div id="headline3">
<div class="splash_headline">
<h4>National TV Spot</h4>
<p>
Check out the commercial, created by Chris Evan, a Class of '00 Alum, that is played during every televised Husker sporting event.
</p>
</div>
</div>
</div>
<div id="posters">
<div id="poster1">
<div id="globeInner" style="opacity:1 !important; display: block !important;width:640px;height:480px;background-color:#000;"></div>
<div style="width:71px; height:77px; background:black; z-index:99999; position:absolute; bottom:0; right:0;"></div>
</div>
<div id="poster2">
<p>Beginning May 11, several of the artist's large ceramic pieces will be placed in Sheldon's Great Hall. On June 19, his paintings and works on paper will open in three second-floor galleries. The exhibition will be on view through Oct. 11. <a href="http://newsroom.unl.edu/releases/2009/04/29/Paintings%2C+objects+of+Jun+Kaneko+opens+May+11+at+Sheldon+Museum+of+Art">Read the full news release.</a></p>
</div>
<div id="poster3">
<object data="http://www.youtube.com/v/-omonwFkkrY%26hl=en%26fs=1%26color1=0x3a3a3a%26color2=0x999999%26enablejsapi=1%26playerapiid=video1" wmode="transparent" id="video1" type="application/x-shockwave-flash" height="340" width="640"><param value="always" name="allowScriptAccess"></object>
</div>
</div>
</div>
</div>
<!-- end moded splash code -->
<br style="clear:both" /><br />
<?php
if (!isloggedin()) {
?>
<div class="col left">
<div id="login-box">
<h2>Students, Faculty, Staff</h2>
<?php
$form_body = "<p class=\"login-box\"><span>Have a my.UNL username and password?</span><br />";
$form_body .= elgg_view('input/submit', array('value' => elgg_echo('UNL Login'))) . "</p>";
$form_body .= "<p><a href=\"". $vars['url'] ."?loginwith=UNLlogin\">" . elgg_echo('register') . "</a> | <a href=\"https://login.unl.edu/faq/account-resetpw.shtml\">" . elgg_echo('user:password:lost') . "</a></p>";
echo elgg_view('input/form', array('body' => $form_body, 'action' => "". $vars['url'] ."?loginwith=UNLlogin"));
?>
</div>
<div id="login-box">
<h2>Friends of UNL</h2>
<?php
$form_body = "<p class=\"login-box\"><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea')) . "</label><br />";
$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea')) . "</label><br />";
$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))) . "</p>";
$form_body .= "<p><a href=\"". $vars['url'] ."account/register.php\">" . elgg_echo('register') . "</a> | <a href=\"". $vars['url'] ."account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>";
echo elgg_view('input/form', array('body' => $form_body, 'action' => "". $vars['url'] ."action/login"));
?>
</div>
</div>
<?php
}
?>
<div class="<?php if (isloggedin()) { echo('four');}else { echo('three');} ?>_col right">
<h2 id="indexheading">The Latest Happenings</h2>
<div class="col left">
<h3 class="sec_main">New Groups</h3>
<?php
$groups = get_entities('group', '', 0, '', 6, 0, false, 0, null);
if($groups){
foreach($groups as $group){
echo "<div class=\"index_item\">";
echo "<div class=\"index_item_icon\">" . elgg_view("profile/icon",array('entity' => $group, 'size' => 'small')) . "</div>";
echo "<div class=\"index_item_name\"><a href=\"" . $group->getUrl() . "\">" . $group->name . "</a><br /><span class=\"membercount\">" . get_group_members($group->guid, 10, 0, 0, true) . " members</span></div>";
echo "</div>";
}
}
?>
</div>
<div class="<?php if (isloggedin()) { echo('two_');} ?>col middle">
<h3 class="sec_main">Discussions</h3>
</div>
<div class="col right">
<h3 class="sec_main">Spotlight Huskers</h3>
</div>
</div>
<?php
/**
* Elgg customindex plugin
* This plugin substitutes the frontpage with a custom one
*
* @package Customdash
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Boris Glumpler
* @copyright Boris Glumpler 2008
* @link /travel-junkie.com
*/
// Put your metadata and js below
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#headlines>div").click(function(){
panelClicked = jQuery(this).attr("id").split('headline')[1];
jQuery("#headlines>div").removeClass("activepanel");
jQuery(this).addClass("activepanel");
jQuery("#posters>div").css({'z-index':'0'});
jQuery("#poster"+panelClicked+"").css({'z-index':'99'});
if(jQuery(this).attr("id") == "headline1"){
jQuery("#FE_InfoWindow").css({'z-index':'2000'});
} else {
jQuery("#FE_InfoWindow").css({'z-index':'0'});
}
});
});
</script>
<!-- begin poly9 globe js -->
<script type="text/javascript" src="http://globe.poly9.com/api.js"></script>
<script type="text/javascript">
//<![CDATA[
var c=0;
var t;
function startMap() {
this.toggleDashboard();
self = this;
letsdothisloop();
};
function letsdothisloop() {
if(c==0)
openLocationFeat('40.8','-96.7','demouser','Lincoln NE','Shane Farritor','Associate Professor, Mechanical Engineering','Shane Farritor, \'92, has conducted promising research on railcar derailment and surgical robots.','Shane_Farritor');
else if(c==1)
openLocationFeat('-15.4081930','28.2871670','demouser','Zambia','Nithal Kuwa','Graduate student, Biological Sciences','Nithal Kuwa\'s research could impact more than 1.8 million children in sub-Saharan Africa.','Nithal_Kuwa');
else {
c=-1;
}
c=c+1;
t=setTimeout("letsdothisloop()",4000);
};
function openLocationFeat(lat, lng, username, location, displayname, title, comment, linkname) {
clearTimeout(t);
var latlng = new FE.LatLng(lat,lng);
self.panTo(latlng,1.5,"easeInOutQuad");
self.zoomTo(19505000,1.5,"easeInOutQuad");
label = window.label = new FE.Pushpin(latlng);
self.addOverlay(label);
label.openInfoWindowHtml('<div id="witw_wrapper"><img class="witw_icon" src="mod/customindex/views/default/customindex/witw_icons/' + linkname + '_medium.jpg" width="60" height="60" /><h1>' + displayname + '</h1><p class="witw_location">' + location + '</p><p class="witw_title">' + title + '</p><p class="witw_comment">' + comment + ' <a href="http://ucommmeranda.unl.edu/workspace/UNL_Featured/husker/' + linkname + '/">Continue Reading...</a></p></div>', 256, 154);
};
function openLocation(lat, lng, username, location, displayname, title, comment) {
clearTimeout(t);
var latlng = new FE.LatLng(lat,lng);
self.panTo(latlng,1.5,"easeInOutQuad");
self.zoomTo(19505000,1.5,"easeInOutQuad");
label = window.label = new FE.Pushpin(latlng);
self.addOverlay(label);
label.openInfoWindowHtml('<div id="witw_wrapper"><img class="witw_icon" src="http://ucommrasmussen.unl.edu/workspace/UNL_Elgg/elgg/mod/profile/icondirect.php?username=' + username + '&size=medium" width="60" height="60" /><h1>' + displayname + '</h1><p class="witw_location">' + location + '</p><p class="witw_title">' + title + '</p><p class="witw_comment">' + comment + '</p></div>', 256, 154);
};
jQuery(document).ready(function() {
var map = new FE.Map(document.getElementById("globeInner"));
map.onLoad = startMap;
map.load();
});
//]]>
</script>
<!-- end poly9 globe js -->
This diff is collapsed.
data/pluginorder.png

221 KiB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0"?>
<pearconfig version="1.0"><php_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/php</php_dir><ext_dir>/usr/local/lib/php/extensions/no-debug-non-zts-20090626/</ext_dir><cfg_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/cfg</cfg_dir><doc_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/docs</doc_dir><bin_dir>/usr/local/bin</bin_dir><data_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/data</data_dir><www_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/www</www_dir><test_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/tests</test_dir><src_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/src</src_dir><php_bin>/usr/local/bin/php</php_bin><php_ini>/usr/local/lib/php.ini</php_ini><php_prefix></php_prefix><php_suffix></php_suffix></pearconfig>
<?xml version="1.0"?>
<pearconfig version="1.0"><php_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/php</php_dir><ext_dir>/usr/local/lib/php/extensions/no-debug-non-zts-20090626/</ext_dir><cfg_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/cfg</cfg_dir><doc_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/docs</doc_dir><bin_dir>/Users/bbieber/workspace/UNL_Elgg/lib/bin</bin_dir><data_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/data</data_dir><www_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/www</www_dir><test_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/tests</test_dir><src_dir>/Users/bbieber/Documents/workspace/UNL_Elgg/lib/src</src_dir><php_bin>/usr/local/bin/php</php_bin><php_ini>/usr/local/lib/php.ini</php_ini><php_prefix></php_prefix><php_suffix></php_suffix></pearconfig>
<?xml version="1.0"?>
<pearconfig version="1.0"><php_dir>/Library/WebServer/Documents/workspace/UNL_Elgg/lib/php</php_dir><ext_dir>/usr/lib/php/extensions/no-debug-non-zts-20090626</ext_dir><cfg_dir>/Library/WebServer/Documents/workspace/UNL_Elgg/lib/cfg</cfg_dir><doc_dir>/Library/WebServer/Documents/workspace/UNL_Elgg/lib/docs</doc_dir><bin_dir>/usr/bin</bin_dir><data_dir>/Library/WebServer/Documents/workspace/UNL_Elgg/lib/data</data_dir><www_dir>/Library/WebServer/Documents/workspace/UNL_Elgg/lib/www</www_dir><test_dir>/Library/WebServer/Documents/workspace/UNL_Elgg/lib/tests</test_dir><src_dir>/Library/WebServer/Documents/workspace/UNL_Elgg/lib/src</src_dir><php_bin>/usr/bin/php</php_bin><php_ini>/private/etc/php.ini</php_ini><php_prefix></php_prefix><php_suffix></php_suffix></pearconfig>
File added
<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0http://pear.php.net/dtd/channel-1.0.xsd">
<name>__uri</name>
<suggestedalias>__uri</suggestedalias>
<summary>Pseudo-channel for static packages</summary>
<servers>
<primary>
<xmlrpc>
<function version="1.0">****</function>
</xmlrpc>
</primary>
</servers>
</channel>
<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0http://pear.php.net/dtd/channel-1.0.xsd">
<name>doc.php.net</name>
<summary>PHP Documentation team</summary>
<suggestedalias>phpdocs</suggestedalias>
<servers>
<primary>
<rest>
<baseurl type="REST1.0">http://doc.php.net/rest/</baseurl>
<baseurl type="REST1.1">http://doc.php.net/rest/</baseurl>
</rest>
</primary>
</servers>
</channel>
<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0http://pear.php.net/dtd/channel-1.0.xsd">
<name>pear.php.net</name>
<suggestedalias>pear</suggestedalias>
<summary>PHP Extension and Application Repository</summary>
<servers>
<primary>
<rest>
<baseurl type="REST1.0">http://pear.php.net/rest/</baseurl>
<baseurl type="REST1.1">http://pear.php.net/rest/</baseurl>
<baseurl type="REST1.2">http://pear.php.net/rest/</baseurl>
<baseurl type="REST1.3">http://pear.php.net/rest/</baseurl>
</rest>
</primary>
<mirror host="us.pear.php.net">
<rest>
<baseurl type="REST1.0">http://us.pear.php.net/rest/</baseurl>
<baseurl type="REST1.1">http://us.pear.php.net/rest/</baseurl>
<baseurl type="REST1.2">http://us.pear.php.net/rest/</baseurl>
<baseurl type="REST1.3">http://us.pear.php.net/rest/</baseurl>
</rest>
</mirror>
<mirror host="de.pear.php.net" ssl="yes" port="3452">
<rest>
<baseurl type="REST1.0">https://de.pear.php.net:3452/rest/</baseurl>
<baseurl type="REST1.1">https://de.pear.php.net:3452/rest/</baseurl>
<baseurl type="REST1.2">https://de.pear.php.net:3452/rest/</baseurl>
<baseurl type="REST1.3">https://de.pear.php.net:3452/rest/</baseurl>
</rest>
</mirror>
</servers>
</channel>