Skip to content

Commit

Permalink
Merge pull request #16 from ucb-ist-drupal/develop
Browse files Browse the repository at this point in the history
Fix openucb-254 bug: Notice: Undefined index: messages in ucberkeley_cas_init() (line 19
  • Loading branch information
bwood committed Jun 16, 2014
2 parents 9a91f71 + 26d814c commit edaa293
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ldap

# OS generated files #
######################
.DS_Store?
.DS_Store
ehthumbs.db
Icon?
Thumbs.db
Expand All @@ -43,3 +43,7 @@ dummy.php
*~
\#*#
README.html

# phpStorm #
############
.idea/*
6 changes: 6 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ucberkeley_cas 7.x-2.0-alpha6
=============================
* OPENUCB-254
** Fix this php warning: Notice: Undefined index: messages in ucberkeley_cas_init() (line 19 of /Users/bwood/code/drupal/bwood/ucberkeley_cas-7/ucberkeley_cas.module).
** Improve make/rebuild.sh and makefiles

ucberkeley_cas 7.x-2.0-alpha5
=============================
* OPENUCB-254
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ Live environments. To manage this manually make these changes at:
A. Two reasons: 1. this module bundles phpCAS which cannot be served from drupal.org for licensing reasons. 2. this module is specific to using Druapl at UC Berkeley and is not useful to the wider Drupal community.

<a name = "admin_login_denied">
## Q. I get the error Access denied when I try to login at user/amdin_login ##
## Q. I get the error Access denied when I try to login at user/admin_login ##
</a>

This can happen if you managed to enable ucberkeley\_cas and you still have the older files for ucb\_cas in your site. To fix this:
Expand Down
30 changes: 25 additions & 5 deletions make/rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,31 @@
# Example:
# sh rebuild.sh /some/directory

if [ -d "$@" ];
MAKEFILE="ucberkeley_cas-7.x.make"

echo "\nSelect your build mode.\n"
echo " [1] Build in release mode."
echo " [2] Build in development mode using -dev.make.\n"
echo "Selection (default: 1): \c"
read SELECTION

if [ "$SELECTION" == "2" ];
then
MAKEFILE="ucberkeley_cas-7.x-dev.make"
fi

echo "Enter the full path at which you want to build ucberkeley_cas (default: /tmp): \c"
read BUILD_DIR

if [ -z "$BUILD_DIR" ];
then
BUILD_DIR="/tmp"
fi

if ! [ -d "$BUILD_DIR" ];
then
BUILD_DIR=$@
else
BUILD_DIR=/tmp
echo "$BUILD_DIR is not a directory."
exit 1
fi

echo "Building in $BUILD_DIR:\n"
Expand All @@ -18,7 +38,7 @@ then
rm -rf $BUILD_DIR/ucberkeley_cas
fi

drush make -y --no-core --no-cache --contrib-destination=. ucberkeley_cas-7.x.make $BUILD_DIR/build_ucberkeley_cas
drush make -y --no-core --no-cache --contrib-destination=. $MAKEFILE $BUILD_DIR/build_ucberkeley_cas
mv $BUILD_DIR/build_ucberkeley_cas/modules/* $BUILD_DIR
mv $BUILD_DIR/cas* $BUILD_DIR/ucberkeley_cas/
mv $BUILD_DIR/ldap $BUILD_DIR/ucberkeley_cas/
Expand Down
29 changes: 29 additions & 0 deletions make/ucberkeley_cas-7.x-dev.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
api = 2
core = 7.x

; phpCAS library
libraries[phpcas][download][type] = "get"
libraries[phpcas][download][url] = "http://downloads.jasig.org/cas-clients/php/current/CAS-1.3.2.tgz"

; CAS
projects[cas][type] = module
projects[cas][version] = 1.2
projects[cas][patch][1394666-cas_library_path-15.patch] = "https://drupal.org/files/cas-library-detection-1394666-15.patch"
projects[cas][patch][1850918-fix-password-asking.patch] = "https://drupal.org/files/1850918-fix-password-asking.patch"

; CAS Attributes
projects[cas_attributes][type] = module
projects[cas_attributes][version] = 1.0-beta2

; LDAP
projects[ldap][type] = module
projects[ldap][version] = 1.0-beta12

; UC Berkeley CAS Feature
; TODO: update dl options
; specify type=module to prevent "No release history was found for the requested project (ucberkeley_cas)."
projects[ucberkeley_cas][type] = "module"
projects[ucberkeley_cas][download][type] = "git"
;;; DEV version, use HEAD of the bwood fork ;;;
projects[ucberkeley_cas][download][url] = "git@github.com:bwood/ucberkeley_cas-7.git"
projects[ucberkeley_cas][download][branch] = "openucb-254-undef-line-19"
12 changes: 7 additions & 5 deletions make/ucberkeley_cas-7.x.make
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ libraries[phpcas][download][type] = "get"
libraries[phpcas][download][url] = "http://downloads.jasig.org/cas-clients/php/current/CAS-1.3.2.tgz"

; CAS
projects[cas] = 1.2
projects[cas][type] = module
projects[cas][version] = 1.2
projects[cas][patch][1394666-cas_library_path-15.patch] = "https://drupal.org/files/cas-library-detection-1394666-15.patch"
projects[cas][patch][1850918-fix-password-asking.patch] = "https://drupal.org/files/1850918-fix-password-asking.patch"

; CAS Attributes
projects[cas_attributes] = 1.0-beta2
projects[cas_attributes][type] = module
projects[cas_attributes][version] = 1.0-beta2

; LDAP
projects[ldap] = 1.0-beta12
projects[ldap][type] = module
projects[ldap][version] = 1.0-beta12

; UC Berkeley CAS Feature
; TODO: update dl options
Expand All @@ -23,5 +26,4 @@ projects[ucberkeley_cas][type] = "module"
projects[ucberkeley_cas][download][type] = "git"
projects[ucberkeley_cas][download][url] = "git@github.com:ucb-ist-drupal/ucberkeley_cas-7.git"
projects[ucberkeley_cas][download][branch] = "master"


projects[ucberkeley_cas][download][tag] = "7.x-2.0-alpha6"
2 changes: 1 addition & 1 deletion ucberkeley_cas.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = Configuration for UC Berkeley Central Authentication (CAS)
core = 7.x
package = UC Berkeley
php = 5.2.4
version = 7.x-2.0-dev
version = 7.x-2.0-alpha6
project = ucberkeley_cas
dependencies[] = cas
dependencies[] = cas_attributes (7.x-1.0-beta2)
Expand Down
2 changes: 1 addition & 1 deletion ucberkeley_cas.module
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function ucberkeley_cas_init() {
}
unset($_SESSION['ucberkeley_cas_install_messages']);
}
elseif ((is_array($_SESSION['messages'])) && (array_key_exists('ucberkeley_cas_installed', $_SESSION))) {
elseif ((array_key_exists('messages', $_SESSION)) && (is_array($_SESSION['messages'])) && (array_key_exists('ucberkeley_cas_installed', $_SESSION))) {
$_SESSION['ucberkeley_cas_install_messages'] = $_SESSION['messages'];
unset($_SESSION['ucberkeley_cas_installed']);
}
Expand Down

0 comments on commit edaa293

Please sign in to comment.