/**
* phpCAS version. accessible for the user by phpCAS::getVersion().
*/
-define('PHPCAS_VERSION', '1.3.7+');
+define('PHPCAS_VERSION', '1.3.8');
/**
* @addtogroup public
// set to callback mode if PgtIou and PgtId CGI GET parameters are provided
if ( $this->isProxy() ) {
- $this->_setCallbackMode(!empty($_GET['pgtIou'])&&!empty($_GET['pgtId']));
+ if(!empty($_GET['pgtIou'])&&!empty($_GET['pgtId'])) {
+ $this->_setCallbackMode(true);
+ $this->_setCallbackModeUsingPost(false);
+ } elseif (!empty($_POST['pgtIou'])&&!empty($_POST['pgtId'])) {
+ $this->_setCallbackMode(true);
+ $this->_setCallbackModeUsingPost(true);
+ } else {
+ $this->_setCallbackMode(false);
+ $this->_setCallbackModeUsingPost(false);
+ }
+
+
}
if ( $this->_isCallbackMode() ) {
return $this->_callback_mode;
}
+ /**
+ * @var bool a boolean to know if the CAS client is using POST parameters when in callback mode.
+ * Written by CAS_Client::_setCallbackModeUsingPost(), read by CAS_Client::_isCallbackModeUsingPost().
+ *
+ * @hideinitializer
+ */
+ private $_callback_mode_using_post = false;
+
+ /**
+ * This method sets/unsets usage of POST parameters in callback mode (default/false is GET parameters)
+ *
+ * @param bool $callback_mode_using_post true to use POST, false to use GET (default).
+ *
+ * @return void
+ */
+ private function _setCallbackModeUsingPost($callback_mode_using_post)
+ {
+ $this->_callback_mode_using_post = $callback_mode_using_post;
+ }
+
+ /**
+ * This method returns true when the callback mode is using POST, false otherwise.
+ *
+ * @return bool A boolean.
+ */
+ private function _isCallbackModeUsingPost()
+ {
+ return $this->_callback_mode_using_post;
+ }
+
/**
* the URL that should be used for the PGT callback (in fact the URL of the
* current request without any CGI parameter). Written and read by
private function _callback()
{
phpCAS::traceBegin();
- if (preg_match('/^PGTIOU-[\.\-\w]+$/', $_GET['pgtIou'])) {
- if (preg_match('/^[PT]GT-[\.\-\w]+$/', $_GET['pgtId'])) {
- $this->printHTMLHeader('phpCAS callback');
- $pgt_iou = $_GET['pgtIou'];
- $pgt = $_GET['pgtId'];
- phpCAS::trace('Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\')');
- echo '<p>Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\').</p>';
- $this->_storePGT($pgt, $pgt_iou);
- $this->printHTMLFooter();
+ if ($this->_isCallbackModeUsingPost()) {
+ $pgtId = $_POST['pgtId'];
+ $pgtIou = $_POST['pgtIou'];
+ } else {
+ $pgtId = $_GET['pgtId'];
+ $pgtIou = $_GET['pgtIou'];
+ }
+ if (preg_match('/^PGTIOU-[\.\-\w]+$/', $pgtIou)) {
+ if (preg_match('/^[PT]GT-[\.\-\w]+$/', $pgtId)) {
+ phpCAS::trace('Storing PGT `'.$pgtId.'\' (id=`'.$pgtIou.'\')');
+ $this->_storePGT($pgtId, $pgtIou);
+ if (array_key_exists('HTTP_ACCEPT', $_SERVER) &&
+ ( $_SERVER['HTTP_ACCEPT'] == 'application/xml' ||
+ $_SERVER['HTTP_ACCEPT'] == 'text/xml'
+ )
+ ) {
+ echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n";
+ echo '<proxySuccess xmlns="http://www.yale.edu/tp/cas" />';
+ phpCAS::traceExit("XML response sent");
+ } else {
+ $this->printHTMLHeader('phpCAS callback');
+ echo '<p>Storing PGT `'.$pgtId.'\' (id=`'.$pgtIou.'\').</p>';
+ $this->printHTMLFooter();
+ phpCAS::traceExit("HTML response sent");
+ }
phpCAS::traceExit("Successfull Callback");
} else {
- phpCAS::error('PGT format invalid' . $_GET['pgtId']);
- phpCAS::traceExit('PGT format invalid' . $_GET['pgtId']);
+ phpCAS::error('PGT format invalid' . $pgtId);
+ phpCAS::traceExit('PGT format invalid' . $pgtId);
}
} else {
- phpCAS::error('PGTiou format invalid' . $_GET['pgtIou']);
- phpCAS::traceExit('PGTiou format invalid' . $_GET['pgtIou']);
+ phpCAS::error('PGTiou format invalid' . $pgtIou);
+ phpCAS::traceExit('PGTiou format invalid' . $pgtIou);
}
// Flush the buffer to prevent from sending anything other then a 200
phpCAS is an authentication library that allows PHP applications to easily authenticate
users via a Central Authentication Service (CAS) server.
-Please see the phpCAS website for more information:
+Please see the wiki website for more information:
https://wiki.jasig.org/display/CASC/phpCAS
-[](https://travis-ci.org/Jasig/phpCAS)
+Api documentation can be found here:
+
+https://apereo.github.io/phpCAS/
+
+
+[](https://travis-ci.org/apereo/phpCAS)
LICENSE
-Description of phpCAS 1.3.7 library import
+Description of phpCAS 1.3.8 library import
-* downloaded from http://downloads.jasig.org/cas-clients/php/current/
-* applied patch https://github.com/apereo/phpCAS/pull/247 for PHP 7.2 compatibility (MDL-60280)
-* applied patch https://github.com/apereo/phpCAS/pull/278 for PHP 7.3 compatibility (MDL-63422)
+* downloaded from http://downloads.jasig.org/cas-clients/php/current/
\ No newline at end of file
$string['site:sendmessage'] = 'Send messages to any user';
$string['site:trustcontent'] = 'Trust submitted content';
$string['site:uploadusers'] = 'Upload new users from file';
+$string['site:viewanonymousevents'] = 'View anonymous events in reports';
$string['site:viewfullnames'] = 'Always see full names of users';
$string['site:viewparticipants'] = 'View participants';
$string['site:viewreports'] = 'View reports';
)
),
+ 'moodle/site:viewanonymousevents' => array(
+
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_MODULE,
+ 'archetypes' => array(
+ 'teacher' => CAP_PROHIBIT,
+ 'editingteacher' => CAP_PROHIBIT,
+ 'manager' => CAP_ALLOW
+ )
+ ),
+
'moodle/site:viewfullnames' => array(
'captype' => 'read',
// Check for non-empty text.
if (Y.Lang.trim(node.get('text')) !== '') {
- foreground = node.getComputedStyle('color');
- background = node.getComputedStyle('backgroundColor');
+ foreground = Y.Color.fromArray(
+ this._getComputedBackgroundColor(node, node.getComputedStyle('color')),
+ Y.Color.TYPES.RGBA
+ );
+ background = Y.Color.fromArray(this._getComputedBackgroundColor(node), Y.Color.TYPES.RGBA);
lum1 = this._getLuminanceFromCssColor(foreground);
lum2 = this._getLuminanceFromCssColor(background);
* Generate the HTML that lists the found warnings.
*
* @method _addWarnings
- * @param {Node} A Node to append the html to.
+ * @param {Node} list Node to append the html to.
* @param {String} description Description of this failure.
* @param {array} nodes An array of failing nodes.
* @param {boolean} imagewarnings true if the warnings are related to images, false if text.
b1 = part1(color[2]);
return 0.2126 * r1 + 0.7152 * g1 + 0.0722 * b1;
+ },
+
+ /**
+ * Get the computed RGB converted to full alpha value, considering the node hierarchy.
+ *
+ * @method _getComputedBackgroundColor
+ * @param {Node} node
+ * @param {String} color The initial colour. If not specified, fetches the backgroundColor from the node.
+ * @return {Array} Colour in Array form (RGBA)
+ * @private
+ */
+ _getComputedBackgroundColor: function(node, color) {
+ color = color || node.getComputedStyle('backgroundColor');
+
+ if (color.toLowerCase() === 'transparent') {
+ // Y.Color doesn't handle 'transparent' properly.
+ color = 'rgba(1, 1, 1, 0)';
+ }
+
+ // Convert the colour to its constituent parts in RGBA format, then fetch the alpha.
+ var colorParts = Y.Color.toArray(color);
+ var alpha = colorParts[3];
+
+ if (alpha === 1) {
+ // If the alpha of the background is already 1, then the parent background colour does not change anything.
+ return colorParts;
+ }
+
+ // Fetch the computed background colour of the parent and use it to calculate the RGB of this item.
+ var parentColor = this._getComputedBackgroundColor(node.get('parentNode'));
+ return [
+ // RGB = (alpha * R|G|B) + (1 - alpha * solid parent colour).
+ (1 - alpha) * parentColor[0] + alpha * colorParts[0],
+ (1 - alpha) * parentColor[1] + alpha * colorParts[1],
+ (1 - alpha) * parentColor[2] + alpha * colorParts[2],
+ // We always return a colour with full alpha.
+ 1
+ ];
}
});
// Only ever send a max of one days worth of updates.
$yesterday = time() - (24 * 3600);
$timenow = time();
- $lastcron = $DB->get_field('modules', 'lastcron', array('name' => 'assign'));
+ $lastruntime = $DB->get_field('task_scheduled', 'lastruntime', array('component' => 'mod_assign'));
// Collect all submissions that require mailing.
// Submissions are included if all are true:
$sql = 'SELECT id
FROM {assign}
WHERE
- allowsubmissionsfromdate >= :lastcron AND
+ allowsubmissionsfromdate >= :lastruntime AND
allowsubmissionsfromdate <= :timenow AND
alwaysshowdescription = 0';
- $params = array('lastcron' => $lastcron, 'timenow' => $timenow);
+ $params = array('lastruntime' => $lastruntime, 'timenow' => $timenow);
$newlyavailable = $DB->get_records_sql($sql, $params);
foreach ($newlyavailable as $record) {
$cm = get_coursemodule_from_instance('assign', $record->id, 0, false, MUST_EXIST);
if (!($this->filterparams->logreader instanceof logstore_legacy\log\store)) {
// Filter out anonymous actions, this is N/A for legacy log because it never stores them.
- $joins[] = "anonymous = 0";
+ if ($this->filterparams->modid) {
+ $context = context_module::instance($this->filterparams->modid);
+ } else {
+ $context = context_course::instance($this->filterparams->courseid);
+ }
+ if (!has_capability('moodle/site:viewanonymousevents', $context)) {
+ $joins[] = "anonymous = 0";
+ }
}
$selector = implode(' AND ', $joins);
$filter->logreader = $readers[$this->selectedlogreader];
$filter->date = $this->date;
$filter->orderby = $this->order;
- $filter->anonymous = 0;
+
+ $context = context_course::instance($filter->courseid);
+ if (!has_capability('moodle/site:viewanonymousevents', $context)) {
+ $filter->anonymous = 0;
+ }
return $filter;
}
defined('MOODLE_INTERNAL') || die();
-$version = 2020010900.00; // YYYYMMDD = weekly release date of this DEV branch.
+$version = 2020010900.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '3.9dev (Build: 20200109)'; // Human-friendly version name