Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 5.4 fixes and translation updated #16

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 116 additions & 51 deletions dictionaries/foodle_foodle.translation.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/API/Contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function prepareContactlist($identifier) {
// echo 'Contact list excludes: ' . var_export(array_keys($excludes));

}
self::exclude(&$result, $excludes);
self::exclude($result, $excludes);

// $this->addme(&$result);

Expand Down Expand Up @@ -224,8 +224,8 @@ function prepareAutoContacts() {
$contacts = $this->contacts->getContacts(10);
}

self::exclude(&$contacts, $excludes);
self::excludeList(&$contacts, $excludesList);
self::exclude($contacts, $excludes);
self::excludeList($contacts, $excludesList);

// error_log(var_export($contacts, TRUE));

Expand Down Expand Up @@ -288,7 +288,7 @@ function prepare() {

$listid = $_REQUEST['excludeList'];
$excludesList = $this->fdb->getContactlist($this->user, $listid);
$this->excludeList(&$contacts, $excludesList);
$this->excludeList($contacts, $excludesList);
}
return $contacts;

Expand Down
8 changes: 4 additions & 4 deletions lib/Data/Foodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public static function requireValidIdentifier($id) {
* Each element in the array (first level) represents one row of
* column headers.
*/
public function getColumnHeaders($headers, $col = NULL, $level = 0) {
public function getColumnHeaders(&$headers, $col = NULL, $level = 0) {
$depth = $this->getColumnDepth();
if ($col === NULL) $col = $this->columns;
foreach($col AS $c) {
Expand All @@ -558,7 +558,7 @@ public function getColumnHeaders($headers, $col = NULL, $level = 0) {
'title' => $c['title'],
'colspan' => count($c['children']),
);
$this->getColumnHeaders(&$headers, $c['children'], $level+1);
$this->getColumnHeaders($headers, $c['children'], $level+1);
} else {
$newheader = array('title' => $c['title']);
if ($level + 1 < $depth) $newheader['rowspan'] = ($depth - $level);
Expand Down Expand Up @@ -621,7 +621,7 @@ public function getColumnList(&$columns, $col = NULL, $strings = array()) {
if (isset($c['children'])) {
$lstrings = $strings;
$lstrings[] = $c['title'];
$this->getColumnList(&$columns, $c['children'], $lstrings);
$this->getColumnList($columns, $c['children'], $lstrings);
} else {
$lstrings = $strings;
# $lstrings[] = $c['title'];
Expand Down Expand Up @@ -687,7 +687,7 @@ public function getColumnDates() {
if (!is_null($this->datecache)) return $this->datecache;

$cols = array();
$this->getColumnList(&$cols);
$this->getColumnList($cols);
$dates = array();
$anyDate = FALSE;

Expand Down
18 changes: 9 additions & 9 deletions lib/FoodleAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,36 +319,36 @@ public function validateAttributes() {
}


self::checkAttribute(&$result, 'User ID', $this->getUserid($attributes), 'fatal', array(
self::checkAttribute($result, 'User ID', $this->getUserid($attributes), 'fatal', array(
array('pattern' => '^.*@(.+?)$')
));

self::checkAttribute(&$result, 'Email address', $this->getEmail($attributes), 'error', array(
self::checkAttribute($result, 'Email address', $this->getEmail($attributes), 'error', array(
array('pattern' => '^.*@(.+?)$', 'pri' => 'error')
));

self::checkAttribute(&$result, 'Name of user', $this->getUsername($attributes), 'error', array(
self::checkAttribute($result, 'Name of user', $this->getUsername($attributes), 'error', array(
array('pattern' => '\s', 'pri' => 'warning', 'text' => 'Name shuold not be a single word. Both firstname and lastname should be included.')
));

self::checkAttribute(&$result, 'User realm', $this->getRealm($attributes), 'error', array(
self::checkAttribute($result, 'User realm', $this->getRealm($attributes), 'error', array(
));

self::checkAttribute(&$result, 'Freebusy Calendar', $this->getCalendar($attributes), 'warning', array(
self::checkAttribute($result, 'Freebusy Calendar', $this->getCalendar($attributes), 'warning', array(
));


self::checkAttribute(&$result, 'Name of Organisation', $this->getOrg($attributes), 'warning', array(
self::checkAttribute($result, 'Name of Organisation', $this->getOrg($attributes), 'warning', array(
));

self::checkAttribute(&$result, 'Name of Organisation Unit (Department)', $this->getOrgunit($attributes), 'warning', array(
self::checkAttribute($result, 'Name of Organisation Unit (Department)', $this->getOrgunit($attributes), 'warning', array(
));

self::checkAttribute(&$result, 'Location of user', $this->getLocation($attributes), 'warning', array(
self::checkAttribute($result, 'Location of user', $this->getLocation($attributes), 'warning', array(
));


self::checkAttribute(&$result, 'Preferred Language of user', $this->getLanguage($attributes), 'warning', array(
self::checkAttribute($result, 'Preferred Language of user', $this->getLanguage($attributes), 'warning', array(
));

return $result;
Expand Down
2 changes: 1 addition & 1 deletion lib/Pages/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function show() {


$cols = array();
$this->foodle->getColumnList(&$cols);
$this->foodle->getColumnList($cols);

// echo '<pre>';
// print_r($this->foodle->getColumnDates());
Expand Down
2 changes: 1 addition & 1 deletion lib/Pages/FDebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function show() {
$this->dump('getColumnHeadersVertical()', $this->foodle->getColumnHeadersVertical());

$col = array();
$this->foodle->getColumnList(&$col);
$this->foodle->getColumnList($col);
$this->dump('getColumnList()', $col);

$this->dump('calculateColumns()', $this->foodle->calculateColumns());
Expand Down
2 changes: 1 addition & 1 deletion lib/XHTMLCol.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function __construct() {
public static function show(SimpleSAML_XHTML_Template $t, Data_Foodle $foodle, $confirm = FALSE) {

$coldef = array();
$foodle->getColumnHeaders(&$coldef);
$foodle->getColumnHeaders($coldef);
$coldepth = $foodle->getColumnDepth();

if($confirm === TRUE) {
Expand Down