Skip to content

Commit 47e8d6c

Browse files
committed
Merge branch '3.1.x'
2 parents 3437def + 6f40ad0 commit 47e8d6c

File tree

151 files changed

+9011
-5052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+9011
-5052
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ cache.properties
1515
lint.cache
1616
tags
1717
.project
18+
.vagrant

.gitmodules

+42
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,45 @@
44
[submodule "app/plugins/extended_test_case"]
55
path = app/plugins/extended_test_case
66
url = https://github.com/jeremyharris/extended_test_case.git
7+
[submodule "puppet/modules/ipeer"]
8+
path = puppet/modules/ipeer
9+
url = https://github.com/ubc/puppet-ipeer.git
10+
[submodule "puppet/modules/stdlib"]
11+
path = puppet/modules/stdlib
12+
url = https://github.com/puppetlabs/puppetlabs-stdlib.git
13+
[submodule "puppet/modules/vcsrepo"]
14+
path = puppet/modules/vcsrepo
15+
url = https://github.com/puppetlabs/puppetlabs-vcsrepo.git
16+
[submodule "puppet/modules/git"]
17+
path = puppet/modules/git
18+
url = https://github.com/theforeman/puppet-git.git
19+
[submodule "puppet/modules/apt"]
20+
path = puppet/modules/apt
21+
url = https://github.com/puppetlabs/puppetlabs-apt.git
22+
[submodule "puppet/modules/firewall"]
23+
path = puppet/modules/firewall
24+
url = https://github.com/puppetlabs/puppetlabs-firewall.git
25+
[submodule "puppet/modules/mysql"]
26+
path = puppet/modules/mysql
27+
url = https://github.com/puppetlabs/puppetlabs-mysql.git
28+
[submodule "puppet/modules/php"]
29+
path = puppet/modules/php
30+
url = https://github.com/thias/puppet-php.git
31+
[submodule "nginx"]
32+
path = puppet/modules/nginx
33+
url = https://github.com/ubc/puppet-nginx.git
34+
[submodule "concat"]
35+
path = puppet/modules/concat
36+
url = https://github.com/puppetlabs/puppetlabs-concat.git
37+
[submodule "puppet/modules/db"]
38+
path = puppet/modules/db
39+
url = https://github.com/ubc/puppet-db.git
40+
[submodule "vendors/webdriver"]
41+
path = vendors/webdriver
42+
url = https://github.com/Element-34/php-webdriver.git
43+
[submodule "vendors/sausage"]
44+
path = vendors/sausage
45+
url = https://github.com/jlipps/sausage.git
46+
[submodule "puppet/modules/epel"]
47+
path = puppet/modules/epel
48+
url = https://github.com/stahnma/puppet-module-epel.git

Vagrantfile

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5+
VAGRANTFILE_API_VERSION = "2"
6+
7+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8+
# All Vagrant configuration is done here. The most common configuration
9+
# options are documented and commented below. For a complete reference,
10+
# please see the online documentation at vagrantup.com.
11+
12+
# Every Vagrant virtual environment requires a box to build off of.
13+
config.vm.box = "ipeerbox"
14+
15+
config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box"
16+
17+
config.vm.define "ipeerdev" do |t|
18+
end
19+
20+
config.vm.provision "puppet" do |puppet|
21+
puppet.manifests_path = "puppet"
22+
puppet.manifest_file = "dev.pp"
23+
puppet.module_path = "puppet/modules"
24+
puppet.options = "--environment development"
25+
end
26+
27+
config.vm.provision :shell, :path => "puppet/bootstrap.sh"
28+
29+
config.vm.network :forwarded_port, host: 2000, guest: 2000
30+
31+
# The url from where the 'config.vm.box' box will be fetched if it
32+
# doesn't already exist on the user's system.
33+
# config.vm.box_url = "http://domain.com/path/to/above.box"
34+
35+
# Create a forwarded port mapping which allows access to a specific port
36+
# within the machine from a port on the host machine. In the example below,
37+
# accessing "localhost:8080" will access port 80 on the guest machine.
38+
# config.vm.network :forwarded_port, guest: 80, host: 8080
39+
40+
# Create a private network, which allows host-only access to the machine
41+
# using a specific IP.
42+
# config.vm.network :private_network, ip: "192.168.33.10"
43+
44+
# Create a public network, which generally matched to bridged network.
45+
# Bridged networks make the machine appear as another physical device on
46+
# your network.
47+
# config.vm.network :public_network
48+
49+
# If true, then any SSH connections made will enable agent forwarding.
50+
# Default value: false
51+
# config.ssh.forward_agent = true
52+
53+
# Share an additional folder to the guest VM. The first argument is
54+
# the path on the host to the actual folder. The second argument is
55+
# the path on the guest to mount the folder. And the optional third
56+
# argument is a set of non-required options.
57+
config.vm.synced_folder ".", "/var/www", id: "vagrant-root",
58+
mount_options: ["dmode=777,fmode=666"]
59+
60+
# Provider-specific configuration so you can fine-tune various
61+
# backing providers for Vagrant. These expose provider-specific options.
62+
# Example for VirtualBox:
63+
#
64+
# config.vm.provider :virtualbox do |vb|
65+
# # Don't boot with headless mode
66+
# vb.gui = true
67+
#
68+
# # Use VBoxManage to customize the VM. For example to change memory:
69+
# vb.customize ["modifyvm", :id, "--memory", "1024"]
70+
# end
71+
#
72+
# View the documentation for the provider you're using for more
73+
# information on available options.
74+
75+
# Enable provisioning with Puppet stand alone. Puppet manifests
76+
# are contained in a directory path relative to this Vagrantfile.
77+
# You will need to create the manifests directory and a manifest in
78+
# the file base.pp in the manifests_path directory.
79+
#
80+
# An example Puppet manifest to provision the message of the day:
81+
#
82+
# # group { "puppet":
83+
# # ensure => "present",
84+
# # }
85+
# #
86+
# # File { owner => 0, group => 0, mode => 0644 }
87+
# #
88+
# # file { '/etc/motd':
89+
# # content => "Welcome to your Vagrant-built virtual machine!
90+
# # Managed by Puppet.\n"
91+
# # }
92+
#
93+
# config.vm.provision :puppet do |puppet|
94+
# puppet.manifests_path = "manifests"
95+
# puppet.manifest_file = "site.pp"
96+
# end
97+
98+
# Enable provisioning with chef solo, specifying a cookbooks path, roles
99+
# path, and data_bags path (all relative to this Vagrantfile), and adding
100+
# some recipes and/or roles.
101+
#
102+
# config.vm.provision :chef_solo do |chef|
103+
# chef.cookbooks_path = "../my-recipes/cookbooks"
104+
# chef.roles_path = "../my-recipes/roles"
105+
# chef.data_bags_path = "../my-recipes/data_bags"
106+
# chef.add_recipe "mysql"
107+
# chef.add_role "web"
108+
#
109+
# # You may also specify custom JSON attributes:
110+
# chef.json = { :mysql_password => "foo" }
111+
# end
112+
113+
# Enable provisioning with chef server, specifying the chef server URL,
114+
# and the path to the validation key (relative to this Vagrantfile).
115+
#
116+
# The Opscode Platform uses HTTPS. Substitute your organization for
117+
# ORGNAME in the URL and validation key.
118+
#
119+
# If you have your own Chef Server, use the appropriate URL, which may be
120+
# HTTP instead of HTTPS depending on your configuration. Also change the
121+
# validation key to validation.pem.
122+
#
123+
# config.vm.provision :chef_client do |chef|
124+
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
125+
# chef.validation_key_path = "ORGNAME-validator.pem"
126+
# end
127+
#
128+
# If you're using the Opscode platform, your validator client is
129+
# ORGNAME-validator, replacing ORGNAME with your organization name.
130+
#
131+
# If you have your own Chef Server, the default validation client name is
132+
# chef-validator, unless you changed the configuration.
133+
#
134+
# chef.validation_client_name = "ORGNAME-validator"
135+
end

app/app_controller.php

+7-15
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,6 @@
1313
App::import('Lib', 'toolkit');
1414
App::import('Lib', 'breadcrumb');
1515

16-
/**
17-
* _t
18-
* because CakePHP 1.3's internationalization __() call is stupid and wants
19-
* you to pass an extra parameter for no reason to get a string, use this
20-
* instead.
21-
*
22-
* @param mixed $str
23-
*
24-
* @access public
25-
* @return void
26-
*/
27-
function _t($str) {
28-
return __($str, true);
29-
}
30-
3116
/**
3217
* AppController the base controller
3318
*
@@ -244,6 +229,13 @@ public function _afterLogin($isRedirect = true)
244229
{
245230
if ($this->Auth->isAuthorized()) {
246231
User::getInstance($this->Auth->user());
232+
// deny access for inactive users
233+
if (User::get('record_status') == 'I') {
234+
$this->Auth->logout();
235+
$this->Session->setFlash(__('Your account is currently inactive.', true));
236+
$this->redirect('/');
237+
return;
238+
}
247239
// after login stuff
248240
$this->User->loadRoles(User::get('id'));
249241
$this->AccessControl->loadPermissions();

app/config/core.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
/**
320320
* iPeer database version
321321
*/
322-
Configure::write('DATABASE_VERSION', 6);
322+
Configure::write('DATABASE_VERSION', 7);
323323

324324

325325
$CWL['LoginURL'] = 'https://www.auth.cwl.ubc.ca/auth/login';
@@ -342,7 +342,7 @@
342342
$CWL['applicationID'] = '';
343343
$CWL['applicationPassword'] = '';
344344

345-
define('IPEER_VERSION', '3.1.3');
345+
define('IPEER_VERSION', '3.1.4');
346346

347347

348348
/**

app/config/routes.php

+8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@
8282
Router::connect('/:controller/courses/:course_id/departments/:department_id',
8383
array('action'=> 'courseDepartments'),
8484
array('course_id' => '[0-9]+', 'department_id' => '[0-9]+'));
85+
// Connect url to users/events api with filters
86+
Router::connect('/:controller/users/:username/events/sub/:sub/results/:results',
87+
array('action' => 'userEvents'),
88+
array('sub' => '[0-1]', 'results' => '[0-1]'));
89+
// connect url to users/events/course api with filters
90+
Router::connect('/:controller/courses/:course_id/users/:username/events/sub/:sub/results/:results',
91+
array('action' => 'userEvents'),
92+
array('course_id' => '[0-9]+', 'sub' => '[0-1]', 'results' => '[0-1]'));
8593
// Connect url to users/events api
8694
Router::connect('/:controller/users/:username/events',
8795
array('action' => 'userEvents'));

0 commit comments

Comments
 (0)