Compare commits

..

96 Commits

Author SHA1 Message Date
Shamim Rezaie 358e1793f2 Moodle release 4.0.10 2023-08-11 23:20:17 +10:00
Huong Nguyen 3a794f0e78 weekly release 4.0.9+ 2023-08-10 22:50:58 +07:00
Huong Nguyen 2a724ee1b9 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-08-10 22:50:56 +07:00
meirzamoodle b797c1314f MDL-78685 auth_oauth2: Added logged-in status check 2023-08-10 18:45:15 +07:00
Jun Pataleta 1f8f229ff0 MDL-78620 auth_cas: Pass base service URL for the CAS client
Since phpCAS v1.6.0, a required base service URL parameterneeds to be
passed to phpCAS::client(). This is basically the protocol, hostname,
and port number (optional) of the site connecting to the CAS server
in order for it to perform service URL discovery.
2023-08-10 18:45:15 +07:00
Jun Pataleta 4a3ef2c34d MDL-78620 auth_cas: Bump thirdpartylibs version to 1.6.0 2023-08-10 18:45:15 +07:00
Jun Pataleta 3bef4646fa MDL-78620 auth_cas: Update phpCAS to v1.6.0 2023-08-10 18:45:15 +07:00
David Woloszyn 56557c04a7 MDL-78620 lib: Set Moodle files after phpCAS upgrade 2023-08-10 18:45:15 +07:00
David Woloszyn 79d7685763 MDL-78620 lib: Upgrade phpCAS to 1.5.0 2023-08-10 18:45:14 +07:00
Michael Hawkins 7d120086ae MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall 2023-08-10 18:45:14 +07:00
Paul Holden 98078b96c8 MDL-78792 message: access checks in processor fragment callback. 2023-08-10 18:45:14 +07:00
raortegar c1ed3e422d MDL-74289 lib: Improve the proxy bypass matching 2023-08-10 18:45:11 +07:00
AMOS bot 57fa64c768 Automatically generated installer lang files 2023-08-08 00:10:27 +00:00
Paul Holden a524ac4bb3 MDL-78647 files: safer unserializing of file reference data. 2023-08-04 12:55:23 +02:00
Shamim Rezaie cddb24754e MDL-66212 tool_lpimport: properly check capabilities
The moodle/competency:competencymanage capability should be checked
before showing the import and export pages.
2023-08-04 12:55:23 +02:00
Matt Porritt eed4592b7c MDL-78340 Blocks: Dashboards now respect block permission overrides
Patch makes user dashboard respect permission overrides
that have been set on individual blocks on the system
dashboard (indexsys.php). When a user dashboard is created
either when the user visits their dashboard for the first
time or after an admin reset. When blcoks are copied to
the new dashbaord overriden permissions are also copied.
2023-08-04 12:55:23 +02:00
Rajneel Totaram 00569bf0fe MDL-71728 mod_quiz: check if user can access this page 2023-08-04 12:55:23 +02:00
Sara Arjona d2b3068edb weekly release 4.0.9+ 2023-08-04 12:40:15 +02:00
Jun Pataleta af2d5ea945 MDL-78498 mod_forum: Prevent race condition in forum recent activity
* Using the generator to create the forum discussions, the timecreated
of a discussion can be set before the user's last course access which
will prevent forum_print_recent_activity() from including this generated
discussion in the recent activity results. To work around this, generate
the forum discussion 1 second after the current time to make sure that
the user's last course access will always be before the discussion's
creation time.
* This patch also includes some optimisations by:
  - Removing the unnecessary @javascript tag for the
    `Time limit expires` scenario
  - Bringing the discussion generation to each scenario to allow each
    scenario to customise the data passed to the generator like for the
    `Time limit expires` scenario.
  - Navigating directly to the forum instance.
2023-08-03 11:33:38 +08:00
Jun Pataleta cdfb51b114 Merge branch 'MDL-78498-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-02 11:22:50 +08:00
Sara Arjona 9077bade59 Merge branch 'MDL-78703-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-08-01 13:45:19 +02:00
Simey Lameze 066ea59ae5 MDL-78498 behat: add support for private replies
This commit adds support for private replies in the
'the following forum replies exist in course' custom step.
2023-08-01 16:08:18 +08:00
Angelia Dela Cruz e24eb760ae MDL-78498 Behat: Use data generators for forum posts and replies
This commit does few things:
* Replace manual forum posts and replies to use data generator.
* It also changes the code to handle social forums.
* Other behat clean-ups and optimization.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-08-01 16:08:18 +08:00
Ilya Tregubov 5ab94239f4 weekly release 4.0.9+ 2023-07-28 10:44:21 +08:00
Ilya Tregubov a42e7c9294 Merge branch 'MDL-78782-400' of https://github.com/ferranrecio/moodle into MOODLE_400_STABLE 2023-07-27 10:00:40 +08:00
Ferran Recio 78d7191ea5 MDL-78782 behat: optimize with editing mode step
The current I am on course homepage with editing mode loads twice the
course page. This patch prevents this from happening by going directly
to editmode.php.
2023-07-26 16:19:48 +02:00
Huong Nguyen 95b25c6049 weekly release 4.0.9+ 2023-07-21 20:56:36 +07:00
AMOS bot 1f18fb7f06 Automatically generated installer lang files 2023-07-19 00:10:57 +00:00
Paul Holden dcc6ad76f1 MDL-78703 behat: fix HTTP GET method capitalization on redirect. 2023-07-15 01:00:09 +01:00
Ilya Tregubov 147c818fb0 weekly release 4.0.9+ 2023-07-14 09:25:45 +08:00
Andrew Nicols bfc7a5e99f Merge branch 'MDL-78157-400' of https://github.com/golenkovm/moodle into MOODLE_400_STABLE 2023-07-13 09:48:31 +08:00
Eloy Lafuente (stronk7) a84a4414da Merge branch 'MDL-78673-400-fix' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-07-12 19:03:31 +02:00
Sara Arjona 90423dac85 MDL-78673 behat: Replace arrow function 2023-07-12 18:46:18 +02:00
Sara Arjona ad99d89bfb Merge branch 'MDL-78673-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-07-12 18:18:27 +02:00
Andrew Nicols 24e0649aa2 Merge branch 'MDL-77450-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-07-13 00:10:32 +08:00
Sara Arjona 66b25cb692 Merge branch 'MDL-78455-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-07-12 17:37:26 +02:00
Angelia Dela Cruz 6fcd9b72ba MDL-77450 Behat: Behat cleanup and optimisation 2023-07-11 14:42:44 +08:00
Andrew Nicols 4136c6b0c9 MDL-78673 grade: Switch test to use generators 2023-07-10 11:31:55 +08:00
Andrew Nicols 64e4988bd6 MDL-78673 grade: Switch to behat navigation steps 2023-07-10 11:31:55 +08:00
Andrew Nicols 7fe6a2d902 MDL-78673 grade: Address random failure due to toast 2023-07-10 11:31:54 +08:00
Andrew Nicols b621be27c7 MDL-78673 behat: Allow plugins to define their expansion of > 2023-07-10 11:31:54 +08:00
Ilya Tregubov 9544616f4c weekly release 4.0.9+ 2023-07-07 11:52:36 +08:00
Ilya Tregubov ef6f73cb66 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-07-07 11:52:33 +08:00
Misha Golenkov 4d1b3728ea MDL-78379 js: Add missing newline character 2023-07-06 16:18:07 +10:00
Jun Pataleta dd7db44ee4 Merge branch 'MDL-78488_400' of https://github.com/t-schroeder/moodle into MOODLE_400_STABLE 2023-07-06 11:18:05 +08:00
Andrew Nicols f3d31d27cf Merge branch 'MDL-78614-400' of https://github.com/noeldemartin/moodle into MOODLE_400_STABLE 2023-07-05 20:31:15 +08:00
Andrew Nicols 256809abf5 Merge branch 'MDL-78158-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-07-05 10:24:19 +08:00
Andrew Nicols 4f39c6e364 Merge branch 'MDL-75324-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-07-04 13:30:26 +08:00
Simey Lameze 7b3360099d MDL-75324 behat: use a proper step to verify completion status 2023-07-04 11:20:32 +08:00
Angelia Dela Cruz 5309a9d11a MDL-78158 behat: Behat cleanup and optimisation 2023-07-04 09:32:31 +08:00
Angelia Dela Cruz 37ec0892ec MDL-78158 Behat: Use data generators to add blocks 2023-07-04 09:11:12 +08:00
AMOS bot 5d1519b3a2 Automatically generated installer lang files 2023-07-04 00:11:34 +00:00
Noel De Martin 498d9ccb4a MDL-78614 behat: Remove trailing quotes 2023-07-03 11:18:56 +02:00
Tim Schroeder 5dbc4d269d MDL-78488 question bank: don't load statistics when they are disabled 2023-06-30 11:45:27 +02:00
AMOS bot 26c2bb411e Automatically generated installer lang files 2023-06-30 00:08:36 +00:00
Huong Nguyen 7a98a43042 weekly release 4.0.9+ 2023-06-29 22:22:26 +07:00
Paul Holden ca3ec4d0b9 Merge branch 'MDL-78521-fix' of https://github.com/sarjona/moodle into MOODLE_400_STABLE 2023-06-29 11:53:29 +01:00
Sara Arjona efc3e28c31 MDL-78521 badges: FixingPHP lint
This patch fixes a PHP lint error introduced in MDL-75552.
As this issue was closed a few weeks ago, I'm adding it to one
random issue integrated this week.

Thanks Eloy and Paul for your help! :-*
2023-06-29 12:39:54 +02:00
Ilya Tregubov 00916e1031 Merge branch 'MDL-77286-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-29 09:44:08 +08:00
Ilya Tregubov 0e60bb75f1 Merge branch 'MDL-78521-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-29 09:38:49 +08:00
Simey Lameze 52966bf12f MDL-77286 behat: change window size to large to avoid random fails 2023-06-27 17:12:28 +08:00
Jun Pataleta 98823e97ce Merge branch 'MDL-76724_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-06-26 19:38:17 +08:00
Simey Lameze 3c143613aa MDL-78521 behat: reload page before asserting content
This commit also reword a Scenario name to make it unique
2023-06-26 11:19:56 +08:00
Eloy Lafuente (stronk7) 1b8b3e9ac8 MDL-76724 environment: Moodle 4.3 requirements
Note that there aren't changes since Moodle 4.2
so this is a complete copy of the information
for that version.
2023-06-24 12:30:08 +02:00
Sara Arjona 5d634426a5 weekly release 4.0.9+ 2023-06-23 09:00:29 +02:00
Sara Arjona ae430b853d Merge branch 'MDL-76635-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-21 14:02:33 +02:00
Simey Lameze a135175c9c MDL-76635 comment: render the delete icon in the right place
Special thanks to Andrew Lyons.
2023-06-21 12:45:45 +08:00
Simey Lameze aa0cef5e5b MDL-76635 behat: improve submission comments test 2023-06-21 12:45:45 +08:00
Ilya Tregubov 5371d63c1a Merge branch 'MDL-77525/400' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-06-20 13:06:07 +08:00
Jun Pataleta c2e6b8083a Merge branch 'MDL-74021-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-06-20 10:13:13 +08:00
Angelia Dela Cruz 2c8f3c7ed5 MDL-74021 behat: Page behat generators use UI
Replace steps that manually add page instances via the UI and use
Behat generators. This improves the speed of Behat test runs.

Co-authored-by: Simey Lameze <simey@moodle.com>
2023-06-19 17:20:13 +08:00
Petr Skoda abc2201890 MDL-77525 filter: add filtering stages 2023-06-17 16:51:08 +02:00
Andrew Nicols 2c14ed0469 weekly release 4.0.9+ 2023-06-16 12:04:34 +08:00
Andrew Nicols 1650d0a1a8 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-06-16 12:04:30 +08:00
Angelia Dela Cruz e79a71ca41 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:21:57 +08:00
Angelia Dela Cruz cb0d17f530 MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-16 09:21:22 +08:00
Ilya Tregubov 00fbed085a Merge branch 'MDL-70152-400-fix' of https://github.com/ilyatregubov/moodle into MOODLE_400_STABLE 2023-06-15 12:11:59 +08:00
Simey Lameze 224da4b2b0 MDL-70152 behat: reply to post using data generator 2023-06-15 12:07:11 +08:00
Andrew Nicols 8ff3117478 Merge branch 'MDL-69231-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-06-15 10:55:48 +08:00
Ilya Tregubov 4ce13b411d Merge branch 'MDL-76733-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-15 10:24:50 +08:00
Andrew Nicols 220132391e MDL-76733 mod_assign: Remove JS requirement for time-based tests
Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:34:06 +08:00
Andrew Nicols 75f833524b MDL-76733 mod_assign: Address random failure
This random failure was happening because of the time required to render
and interact with the file picker which sometimes exceeded 2 seconds,
depending on the speed of the machine running the tests.

Converting these tests to use an onlinetext submission and drop the JS
requirement means that they are much less susceptible to runtime issues,
and not susceptible to those caused by JS at all.
2023-06-15 09:33:42 +08:00
AMOS bot afedc33bd5 Automatically generated installer lang files 2023-06-15 00:16:18 +00:00
Sara Arjona f0de6ba61b Merge branch 'MDL-76733-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-14 16:22:49 +02:00
Jun Pataleta 2b4e791a66 Merge branch 'MDL-78466-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-06-14 16:00:04 +08:00
Ilya Tregubov cbea4fa598 Merge branch 'MDL-70152-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-06-14 13:25:29 +08:00
Andrew Nicols 01e9d88cef MDL-78466 cache: Add new result_found helper
This helper is intended to prevent recurrences of this issue by moving
the guess-work to something well tested.
2023-06-14 09:35:40 +08:00
Andrew Nicols dbdd331392 MDL-78466 cache: Perform strict test on static cache values
If a statically accelerated cache returns an empty array then the value
was still fetched from the non-static cache store.

The check of the `$result` should be strictly checked against `false`,
which is the value used if no value was found.
2023-06-14 09:28:48 +08:00
Simey Lameze 78aa80dd5f MDL-69231 behat: remaining work for role capability generator
This commit does few things:
* Unify data generators usage to role short name.
* Replace remaining manual steps to use the new data generator.
* Also replaced other manual steps to set config to use data generators.
* Tidy up of some tests, aligning pipes and splitting one line steps into multiple lines.
* Fixes tests to have one Given/When/Then per scenario.
2023-06-02 12:39:52 +08:00
Andrew Nicols 063e8fb534 MDL-69231 behat: Update tests to use new generator 2023-06-02 12:39:52 +08:00
Andrew Nicols 091aa9b872 MDL-69231 tests: Add role capability setting generator 2023-06-02 12:39:52 +08:00
Andrew Nicols 521e21d842 MDL-69231 tests: Improve existing role generator
Support definition of context levels and permissions.
2023-06-02 12:39:52 +08:00
Angelia Dela Cruz e0e4b2fad2 MDL-70152 behat: Forum behat generators use UI
Behat cleanup and optimisation
2023-05-29 10:24:10 +08:00
Angelia Dela Cruz b6928826e1 MDL-70152 behat: Forum behat generators use UI
Replace steps that manually add forum and forum post instances
via the UI and use Behat generators. This improves the speed of
Behat test runs.
2023-05-29 10:24:02 +08:00
Andrew Nicols 35cea45566 MDL-70152 forum: Create behat data generator
* Convert track_read_posts.feature to use activity and discussion
data generators as exmaple.

Co-authored-by: Jun Pataleta <jun@moodle.com>
2023-05-29 10:24:02 +08:00
Andrew Nicols 8340d958cd MDL-76733 mod_assign: Tidy up availability behat tests
This feature had lots of small issues and it made sense to fix it whilst
investigating a query:

* most of the steps do not require JavaScript
* it uses the UI to set an admin setting, for every scenario:
** only 3-4 of the scenarios actually test that setting
** it is very slow to do it his way when we have a generator step we can use
* we create two assignments in the Background, but each test only uses one of them
* we create the assignments in the Background with a generator, but
  update them to modify various settings in each Scenario using the UI
  when we should just create one assignment for each test and set it up
  correctly for that Scenario
2023-05-23 10:58:07 +08:00
313 changed files with 3453 additions and 3381 deletions
+189
View File
@@ -4114,4 +4114,193 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.3" requires="3.11.8">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="exif" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
<FEEDBACK>
<ON_ERROR message="sixtyfourbitsrequired" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
@@ -34,8 +34,11 @@ Feature: Manage availability conditions
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activity" exists:
| activity | page |
| course | C1 |
| name | P1 |
And I log in as "admin"
And I am on site homepage
When I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
@@ -51,8 +54,7 @@ Feature: Manage availability conditions
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
And I click on "Hide" "icon" in the "Restriction by grade" "table_row"
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And "Add restriction..." "dialogue" should be visible
@@ -21,12 +21,15 @@ Feature: Edit capabilities
Scenario: Default system capabilities modification
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
And I navigate to "Users > Permissions > Define roles" in site administration
And I click on "Edit Teacher role" "link"
And I fill the capabilities form with the following permissions:
| capability | permission |
| block/mnet_hosts:myaddinstance | Allow |
| moodle/site:messageanyuser | Inherit |
| moodle/grade:managesharedforms | Prevent |
| moodle/course:request | Prohibit |
And I press "Save changes"
When I follow "Edit Teacher role"
Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission
And "moodle/site:messageanyuser" capability has "Not set" permission
@@ -48,16 +51,12 @@ Feature: Edit capabilities
And "mod/forum:addquestion" capability has "Allow" permission
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And the following "activity" exists:
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | 00001 |
| name | I'm the name |
| intro | I'm the introduction |
| section | 1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "I'm the name"
And I am on the "I'm the name" "forum activity" page logged in as teacher1
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
@@ -30,6 +30,12 @@ Feature: Protected data should not be deleted
| Site purpose | PT1H | 0 |
| prot | P1D | 1 |
| unprot | P1D | 0 |
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| u1 | forump1 | Discussion subject | Test post in forump1 |
| u1 | forumu1 | Discussion subject | Test post in forumu1 |
| u1 | forump2 | Discussion subject | Test post in forump2 |
| u1 | forumu2 | Discussion subject | Test post in forumu2 |
And I set the category and purpose for the "forump1" "forum" in course "C1" to "CAT" and "prot"
And I set the category and purpose for the "forump2" "forum" in course "C2" to "CAT" and "prot"
And I set the category and purpose for the "forumu1" "forum" in course "C1" to "CAT" and "unprot"
@@ -38,47 +44,25 @@ Feature: Protected data should not be deleted
@javascripta
Scenario: Unexpired and protected data is not removed
Given I log in as "u1"
And I am on "C1" course homepage
And I add a new discussion to "forump1" forum with:
| Subject | Discussion subject |
| Message | Test post in forump1 |
And I am on "C1" course homepage
And I add a new discussion to "forumu1" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu1 |
And I am on "C2" course homepage
And I add a new discussion to "forump2" forum with:
| Subject | Discussion subject |
| Message | Test post in forump2 |
And I am on "C2" course homepage
And I add a new discussion to "forumu2" forum with:
| Subject | Discussion subject |
| Message | Test post in forumu2 |
And I log out
And I log in as "admin"
Given I log in as "admin"
And I create a dataprivacy "delete" request for "u1"
And I approve a dataprivacy "delete" request for "u1"
And I run all adhoc tasks
And I navigate to "Users > Privacy and policies > Data requests" in site administration
And I should see "Deleted" in the "u1" "table_row"
And I am on "C1" course homepage
And I follow "forump1"
And I am on the "forump1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forump1"
When I am on "C1" course homepage
And I follow "forumu1"
When I am on the "forumu1" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu1"
And I am on "C2" course homepage
And I follow "forump2"
And I am on the "forump2" "forum activity" page
And I follow "Discussion subject"
Then I should see "Test post in forump2"
When I am on "C2" course homepage
And I follow "forumu2"
When I am on the "forumu2" "forum activity" page
And I follow "Discussion subject"
Then I should not see "Test post in forumu2"
+11 -17
View File
@@ -15,6 +15,17 @@ Feature: Manage plan workflow
| usermanageowndraftplan | User manage own draft plan role | user |
| usermanageownplan | User manage own plan role | user |
| manageplan | Manager all plans role | manager |
And the following "role capabilities" exist:
| role | moodle/competency:planmanageowndraft | moodle/competency:planmanageown |
| usermanageowndraftplan | allow | |
| usermanageownplan | allow | allow |
| manageplan | allow | allow |
And the following "role capability" exists:
| role | manageplan |
| moodle/competency:planmanage | allow |
| moodle/competency:planview | allow |
| moodle/competency:planreview | allow |
| moodle/competency:planrequestreview | allow |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | usermanageowndraftplan | System | |
@@ -40,23 +51,6 @@ Feature: Manage plan workflow
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| lp | System | 1 | my-index | content |
And I log in as "admin"
And I set the following system permissions of "User manage own draft plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
And I set the following system permissions of "User manage own plan role" role:
| capability | permission |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planmanageown | Allow |
And I set the following system permissions of "Manager all plans role" role:
| capability | permission |
| moodle/competency:planmanage | Allow |
| moodle/competency:planmanagedraft | Allow |
| moodle/competency:planmanageowndraft | Allow |
| moodle/competency:planview | Allow |
| moodle/competency:planreview | Allow |
| moodle/competency:planrequestreview | Allow |
And I log out
Scenario: User can manages his own plan draft
Given I log in as "user1"
+2
View File
@@ -25,6 +25,8 @@
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpexportcsv');
$pagetitle = get_string('exportnavlink', 'tool_lpimportcsv');
$context = context_system::instance();
+2
View File
@@ -25,6 +25,8 @@ define('NO_OUTPUT_BUFFERING', true);
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toollpimportcsv');
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
$context = context_system::instance();
@@ -169,10 +169,9 @@ Feature: tool_monitor_subscriptions
And I should not see "You can manage rules the from the Event monitoring rules page."
Scenario: No manage rules link when user does not have permission
Given I log in as "admin"
And I set the following system permissions of "Non-editing teacher" role:
| tool/monitor:managerules | Prohibit |
And I log out
Given the following "role capability" exists:
| role | teacher |
| tool/monitor:managerules | prohibit |
And I log in as "teacher1"
And I follow "Preferences" in the user menu
And I follow "Event monitoring"
@@ -48,15 +48,18 @@ use tool_policy\policy_version;
*/
class page_viewalldoc implements renderable, templatable {
/** @var string Return url */
private $returnurl;
/** @var ?moodle_url Return url */
private $returnurl = null;
/**
* Prepare the page for rendering.
*
*/
public function __construct($returnurl) {
$this->returnurl = $returnurl;
if (!empty($returnurl)) {
$this->returnurl = new moodle_url($returnurl);
}
$this->prepare_global_page_access();
$this->prepare_policies();
}
@@ -48,11 +48,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "User Two" "table_row"
Scenario: Agree on behalf of another user as a manager, single policy, javascript off
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -73,11 +71,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, single policy, javascript on
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -135,13 +131,13 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And "Pending" "text" should exist in the "This privacy policy" "table_row"
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript off
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Continue"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -167,14 +163,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -215,11 +211,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I should not see "Policies and agreements"
Scenario: Policies and agreements profile link visible also for users who can access on behalf of others
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -231,11 +225,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
Then I should see "Policies and agreements"
Scenario: Agree on behalf of another user as an admin who is logged in as a manager
Given I log in as "admin"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
When I log in as "manager"
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
@@ -261,14 +253,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
@javascript
Scenario: Bulk agree on behalf of another users as a manager, multiple policies, javascript on
Given I log in as "admin"
Given the following "role capability" exists:
| role | manager |
| tool/policy:acceptbehalf | allow |
And I log in as "admin"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
And I press "Activate"
And I set the following system permissions of "Manager" role:
| capability | permission |
| tool/policy:acceptbehalf | Allow |
And I log out
When I log in as "manager"
And I press "Next"
@@ -153,14 +153,10 @@ Feature: Apply tour filters to a tour
| Course 1 | C1 | topics | 1 |
| Course 2 | C2 | topics | 1 |
And the following "activities" exist:
| activity | course | name | firstpagetitle | wikimode |
| wiki | C1 | Test wiki name | First page | collaborative |
| activity | course | name | firstpagetitle | wikimode | idnumber | intro | type |
| wiki | C1 | Test wiki name | First page | collaborative | | | |
| forum | C2 | Test forum name | | | 001 | Test forum description | general |
And I log in as "admin"
And I am on "Course 2" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
And I add a new user tour with:
| Name | Wiki tour |
| Description | A tour with both matches |
+7 -5
View File
@@ -1,18 +1,20 @@
Description of phpCAS 1.4.0 import into Moodle
Description of phpCAS import into Moodle
Last release package can be found in hhttps://github.com/apereo/phpCAS/releases
Last release can be found at https://github.com/apereo/phpCAS/releases
NOTICE:
* Before running composer command, make sure you have the composer version updated.
* Composer version 2.2.4 2022-01-08 12:30:42
STEPS:
* Create a temporary folder outside your moodle installation
* Execute `composer require apereo/phpcas:VERSION`
* Make sure you're using the lowest supported PHP version for the given release (e.g. PHP 7.4 for Moodle 4.1)
* Create a temporary folder outside your Moodle installation
* Execute 'composer require apereo/phpcas:VERSION'
* Check any new libraries that have been added and make sure they do not exist in Moodle already.
* Remove the old 'vendor' directory in auth/cas/CAS/
* Copy contents of 'vendor' directory
* Create a commit with only the library changes
* Create a commit with only the library changes.
- Note: Make sure to check the list of unversioned files and add any new files to the staging area.
* Update auth/cas/thirdpartylibs.xml
* Apply the modifications described in the CHANGES section
* Create another commit with the previous two steps of changes
+1 -1
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS.php
* @category Authentication
+1 -1
View File
@@ -13,7 +13,7 @@ Api documentation can be found here:
https://apereo.github.io/phpCAS/api/
[![Build Status](https://travis-ci.org/apereo/phpCAS.png)](https://travis-ci.org/apereo/phpCAS)
[![Test](https://github.com/apereo/phpCAS/actions/workflows/test.yml/badge.svg)](https://github.com/apereo/phpCAS/actions/workflows/test.yml)
LICENSE
-------
+11 -7
View File
@@ -22,13 +22,15 @@
}
],
"require" : {
"php" : ">=7.0.0",
"php" : ">=7.1.0",
"ext-curl" : "*",
"psr/log" : "^1.0.0"
},
"ext-dom" : "*",
"psr/log" : "^1.0 || ^2.0 || ^3.0"
},
"require-dev" : {
"monolog/monolog" : "^1.0.0",
"phpunit/phpunit" : ">=4.8.35 <8"
"monolog/monolog" : "^1.0.0 || ^2.0.0",
"phpunit/phpunit" : ">=7.5",
"phpstan/phpstan" : "^1.5"
},
"autoload" : {
"classmap" : [
@@ -36,16 +38,18 @@
]
},
"autoload-dev" : {
"files": ["source/CAS.php"],
"psr-4" : {
"PhpCas\\" : "test/CAS/"
}
},
"scripts" : {
"test" : "phpunit"
"test" : "phpunit",
"phpstan" : "phpstan"
},
"extra" : {
"branch-alias" : {
"dev-master" : "1.3.x-dev"
}
}
}
}
+11 -19
View File
@@ -1,21 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="source/CAS.php"
convertNoticesToExceptions="false"
colors="true"
stderr="true"
backupGlobals="true"
>
<testsuites>
<testsuite name="phpCAS Tests">
<directory>test/CAS/Tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory>source/</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="source/CAS.php" convertNoticesToExceptions="false" colors="true" stderr="true" backupGlobals="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="false">
<include>
<directory>source/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="phpCAS Tests">
<directory>test/CAS/Tests/</directory>
</testsuite>
</testsuites>
</phpunit>
+24 -13
View File
@@ -20,7 +20,7 @@
*
*
* Interface class of the phpCAS library
* PHP Version 5
* PHP Version 7
*
* @file CAS/CAS.php
* @category Authentication
@@ -57,7 +57,7 @@ if (!isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME']) && isset($
/**
* phpCAS version. accessible for the user by phpCAS::getVersion().
*/
define('PHPCAS_VERSION', '1.4.0');
define('PHPCAS_VERSION', '1.6.0');
/**
* @addtogroup public
@@ -136,11 +136,6 @@ define("SAML_SOAP_ENV_CLOSE", '</SOAP-ENV:Envelope>');
*/
define("SAML_ATTRIBUTES", 'SAMLATTRIBS');
/**
* SAML Attributes
*/
define("DEFAULT_ERROR", 'Internal script failure');
/** @} */
/**
* @addtogroup publicPGTStorage
@@ -332,6 +327,14 @@ class phpCAS
* @param string $server_hostname the hostname of the CAS server
* @param int $server_port the port the CAS server is running on
* @param string $server_uri the URI the CAS server is responding on
* @param string|string[]|CAS_ServiceBaseUrl_Interface
* $service_base_url the base URL (protocol, host and the
* optional port) of the CAS client; pass
* in an array to use auto discovery with
* an allowlist; pass in
* CAS_ServiceBaseUrl_Interface for custom
* behavior. Added in 1.6.0. Similar to
* serverName config in other CAS clients.
* @param bool $changeSessionID Allow phpCAS to change the session_id
* (Single Sign Out/handleLogoutRequests
* is based on that change)
@@ -343,7 +346,8 @@ class phpCAS
* and phpCAS::setDebug()).
*/
public static function client($server_version, $server_hostname,
$server_port, $server_uri, $changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
$server_port, $server_uri, $service_base_url,
$changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
) {
phpCAS :: traceBegin();
if (is_object(self::$_PHPCAS_CLIENT)) {
@@ -362,7 +366,7 @@ class phpCAS
// initialize the object $_PHPCAS_CLIENT
try {
self::$_PHPCAS_CLIENT = new CAS_Client(
$server_version, false, $server_hostname, $server_port, $server_uri,
$server_version, false, $server_hostname, $server_port, $server_uri, $service_base_url,
$changeSessionID, $sessionHandler
);
} catch (Exception $e) {
@@ -378,6 +382,14 @@ class phpCAS
* @param string $server_hostname the hostname of the CAS server
* @param string $server_port the port the CAS server is running on
* @param string $server_uri the URI the CAS server is responding on
* @param string|string[]|CAS_ServiceBaseUrl_Interface
* $service_base_url the base URL (protocol, host and the
* optional port) of the CAS client; pass
* in an array to use auto discovery with
* an allowlist; pass in
* CAS_ServiceBaseUrl_Interface for custom
* behavior. Added in 1.6.0. Similar to
* serverName config in other CAS clients.
* @param bool $changeSessionID Allow phpCAS to change the session_id
* (Single Sign Out/handleLogoutRequests
* is based on that change)
@@ -389,7 +401,8 @@ class phpCAS
* and phpCAS::setDebug()).
*/
public static function proxy($server_version, $server_hostname,
$server_port, $server_uri, $changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
$server_port, $server_uri, $service_base_url,
$changeSessionID = true, \SessionHandlerInterface $sessionHandler = null
) {
phpCAS :: traceBegin();
if (is_object(self::$_PHPCAS_CLIENT)) {
@@ -408,7 +421,7 @@ class phpCAS
// initialize the object $_PHPCAS_CLIENT
try {
self::$_PHPCAS_CLIENT = new CAS_Client(
$server_version, true, $server_hostname, $server_port, $server_uri,
$server_version, true, $server_hostname, $server_port, $server_uri, $service_base_url,
$changeSessionID, $sessionHandler
);
} catch (Exception $e) {
@@ -597,8 +610,6 @@ class phpCAS
}
if (self::$_PHPCAS_VERBOSE) {
echo "<br />\n<b>phpCAS error</b>: <font color=\"FF0000\"><b>" . __CLASS__ . "::" . $function . '(): ' . htmlentities($msg) . "</b></font> in <b>" . $file . "</b> on line <b>" . $line . "</b><br />\n";
} else {
echo "<br />\n<b>Error</b>: <font color=\"FF0000\"><b>". DEFAULT_ERROR ."</b><br />\n";
}
phpCAS :: trace($msg . ' in ' . $file . 'on line ' . $line );
phpCAS :: traceEnd();
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/AuthenticationException.php
* @category Authentication
@@ -72,11 +72,15 @@ implements CAS_Exception
phpCAS::traceBegin();
$lang = $client->getLangObj();
$client->printHTMLHeader($lang->getAuthenticationFailed());
printf(
$lang->getYouWereNotAuthenticated(),
htmlentities($client->getURL()),
isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN']:''
);
if (phpCAS::getVerbose()) {
printf(
$lang->getYouWereNotAuthenticated(),
htmlentities($client->getURL()),
$_SERVER['SERVER_ADMIN'] ?? ''
);
}
phpCAS::trace($messages[] = 'CAS URL: '.$cas_url);
phpCAS::trace($messages[] = 'Authentication failure: '.$failure);
if ( $no_response ) {
+4 -4
View File
@@ -3,7 +3,7 @@
/**
* Autoloader Class
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Autoload.php
* @category Authentication
@@ -68,12 +68,12 @@ function CAS_autoload($class)
);
$trace = $e->getTrace();
if (isset($trace[2]) && isset($trace[2]['function'])
&& in_array($trace[2]['function'], array('class_exists', 'interface_exists'))
&& in_array($trace[2]['function'], array('class_exists', 'interface_exists', 'trait_exists'))
) {
return false;
}
if (isset($trace[1]) && isset($trace[1]['function'])
&& in_array($trace[1]['function'], array('class_exists', 'interface_exists'))
&& in_array($trace[1]['function'], array('class_exists', 'interface_exists', 'trait_exists'))
) {
return false;
}
@@ -92,4 +92,4 @@ if (!class_exists('CAS_Client'))
// it to the autoload stack
spl_autoload_register('__autoload');
}
}
}
+102 -69
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Client.php
* @category Authentication
@@ -102,6 +102,10 @@ class CAS_Client
*/
public function printHTMLHeader($title)
{
if (!phpCAS::getVerbose()) {
return;
}
$this->_htmlFilterOutput(
str_replace(
'__TITLE__', $title,
@@ -130,16 +134,17 @@ class CAS_Client
*/
public function printHTMLFooter()
{
if (!phpCAS::getVerbose()) {
return;
}
$lang = $this->getLangObj();
$this->_htmlFilterOutput(
empty($this->_output_footer)?
(phpCAS::getVerbose())?
'<hr><address>phpCAS __PHPCAS_VERSION__ '
.$lang->getUsingServer()
.' <a href="__SERVER_BASE_URL__">__SERVER_BASE_URL__</a> (CAS __CAS_VERSION__)</a></address></body></html>'
:'</body></html>'
:$this->_output_footer
);
$message = empty($this->_output_footer)
? '<hr><address>phpCAS __PHPCAS_VERSION__ ' . $lang->getUsingServer() .
' <a href="__SERVER_BASE_URL__">__SERVER_BASE_URL__</a> (CAS __CAS_VERSION__)</a></address></body></html>'
: $this->_output_footer;
$this->_htmlFilterOutput($message);
}
/**
@@ -174,6 +179,21 @@ class CAS_Client
$this->_output_footer = $footer;
}
/**
* Simple wrapper for printf function, that respects
* phpCAS verbosity setting.
*
* @param string $format
* @param string|int|float ...$values
*
* @see printf()
*/
private function printf(string $format, ...$values): void
{
if (phpCAS::getVerbose()) {
printf($format, ...$values);
}
}
/** @} */
@@ -898,6 +918,14 @@ class CAS_Client
* @param bool $changeSessionID Allow phpCAS to change the session_id
* (Single Sign Out/handleLogoutRequests
* is based on that change)
* @param string|string[]|CAS_ServiceBaseUrl_Interface
* $service_base_url the base URL (protocol, host and the
* optional port) of the CAS client; pass
* in an array to use auto discovery with
* an allowlist; pass in
* CAS_ServiceBaseUrl_Interface for custom
* behavior. Added in 1.6.0. Similar to
* serverName config in other CAS clients.
* @param \SessionHandlerInterface $sessionHandler the session handler
*
* @return self a newly created CAS_Client object
@@ -908,6 +936,7 @@ class CAS_Client
$server_hostname,
$server_port,
$server_uri,
$service_base_url,
$changeSessionID = true,
\SessionHandlerInterface $sessionHandler = null
) {
@@ -925,6 +954,8 @@ class CAS_Client
if (gettype($changeSessionID) != 'boolean')
throw new CAS_TypeMismatchException($changeSessionID, '$changeSessionID', 'boolean');
$this->_setServiceBaseUrl($service_base_url);
if (empty($sessionHandler)) {
$sessionHandler = new CAS_Session_PhpSession;
}
@@ -1029,7 +1060,7 @@ class CAS_Client
if ( $this->_isCallbackMode() ) {
//callback mode: check that phpCAS is secured
if ( !$this->_isHttps() ) {
if ( !$this->getServiceBaseUrl()->isHttps() ) {
phpCAS::error(
'CAS proxies must be secured to use phpCAS; PGT\'s will not be received from the CAS server'
);
@@ -1037,7 +1068,7 @@ class CAS_Client
} else {
//normal mode: get ticket and remove it from CGI parameters for
// developers
$ticket = (isset($_GET['ticket']) ? $_GET['ticket'] : null);
$ticket = (isset($_GET['ticket']) ? $_GET['ticket'] : '');
if (preg_match('/^[SP]T-/', $ticket) ) {
phpCAS::trace('Ticket \''.$ticket.'\' found');
$this->setTicket($ticket);
@@ -1553,7 +1584,7 @@ class CAS_Client
{
phpCAS::traceBegin();
$res = false;
$validate_url = '';
if ( $this->_wasPreviouslyAuthenticated() ) {
if ($this->hasTicket()) {
// User has a additional ticket but was already authenticated
@@ -1587,6 +1618,10 @@ class CAS_Client
$this->markAuthenticationCall($res);
} else {
if ($this->hasTicket()) {
$validate_url = '';
$text_response = '';
$tree_response = '';
switch ($this->getServerVersion()) {
case CAS_VERSION_1_0:
// if a Service Ticket was given, validate it
@@ -1650,7 +1685,7 @@ class CAS_Client
$logoutTicket = $this->getTicket();
break;
default:
phpCAS::trace('Protocoll error');
phpCAS::trace('Protocol error');
break;
}
} else {
@@ -1827,7 +1862,7 @@ class CAS_Client
phpCAS::trace("Redirect to : ".$cas_url);
$lang = $this->getLangObj();
$this->printHTMLHeader($lang->getAuthenticationWanted());
printf('<p>'. $lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printf('<p>'. $lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printHTMLFooter();
phpCAS::traceExit();
throw new CAS_GracefullTerminationException();
@@ -1870,7 +1905,7 @@ class CAS_Client
}
$lang = $this->getLangObj();
$this->printHTMLHeader($lang->getLogout());
printf('<p>'.$lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printf('<p>'.$lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
$this->printHTMLFooter();
phpCAS::traceExit();
throw new CAS_GracefullTerminationException();
@@ -2159,6 +2194,8 @@ class CAS_Client
$validate_url .= '&renew=true';
}
$headers = '';
$err_msg = '';
// open and read the URL
if ( !$this->_readURL($validate_url, $headers, $text_response, $err_msg) ) {
phpCAS::trace(
@@ -2235,6 +2272,8 @@ class CAS_Client
$validate_url .= '&renew=true';
}
$headers = '';
$err_msg = '';
// open and read the URL
if ( !$this->_readURL($validate_url, $headers, $text_response, $err_msg) ) {
phpCAS::trace(
@@ -2550,8 +2589,7 @@ class CAS_Client
// the URL is built when needed only
if ( empty($this->_callback_url) ) {
// remove the ticket if present in the URL
$final_uri = 'https://';
$final_uri .= $this->_getClientUrl();
$final_uri = $this->getServiceBaseUrl()->get();
$request_uri = $_SERVER['REQUEST_URI'];
$request_uri = preg_replace('/\?.*$/', '', $request_uri);
$final_uri .= $request_uri;
@@ -2892,6 +2930,8 @@ class CAS_Client
$cas_url = $this->getServerProxyURL().'?targetService='
.urlencode($target_service).'&pgt='.$this->_getPGT();
$headers = '';
$cas_response = '';
// open and read the URL
if ( !$this->_readURL($cas_url, $headers, $cas_response, $err_msg) ) {
phpCAS::trace(
@@ -3917,10 +3957,7 @@ class CAS_Client
// the URL is built when needed only
if ( empty($this->_url) ) {
// remove the ticket if present in the URL
$final_uri = ($this->_isHttps()) ? 'https' : 'http';
$final_uri .= '://';
$final_uri .= $this->_getClientUrl();
$final_uri = $this->getServiceBaseUrl()->get();
$request_uri = explode('?', $_SERVER['REQUEST_URI'], 2);
$final_uri .= $request_uri[0];
@@ -3957,65 +3994,61 @@ class CAS_Client
return $this->_server['base_url'] = $url;
}
/**
* The ServiceBaseUrl object that provides base URL during service URL
* discovery process.
*
* @var CAS_ServiceBaseUrl_Interface
*
* @hideinitializer
*/
private $_serviceBaseUrl = null;
/**
* Try to figure out the phpCAS client URL with possible Proxys / Ports etc.
* Answer the CAS_ServiceBaseUrl_Interface object for this client.
*
* @return string Server URL with domain:port
* @return CAS_ServiceBaseUrl_Interface
*/
private function _getClientUrl()
public function getServiceBaseUrl()
{
if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
// explode the host list separated by comma and use the first host
$hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST']);
// see rfc7239#5.3 and rfc7230#2.7.1: port is in HTTP_X_FORWARDED_HOST if non default
return $hosts[0];
} else if (!empty($_SERVER['HTTP_X_FORWARDED_SERVER'])) {
$server_url = $_SERVER['HTTP_X_FORWARDED_SERVER'];
} else {
if (empty($_SERVER['SERVER_NAME'])) {
$server_url = $_SERVER['HTTP_HOST'];
} else {
$server_url = $_SERVER['SERVER_NAME'];
}
if (empty($this->_serviceBaseUrl)) {
phpCAS::error("ServiceBaseUrl object is not initialized");
}
if (!strpos($server_url, ':')) {
if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
$server_port = $_SERVER['SERVER_PORT'];
} else {
$ports = explode(',', $_SERVER['HTTP_X_FORWARDED_PORT']);
$server_port = $ports[0];
}
if ( ($this->_isHttps() && $server_port!=443)
|| (!$this->_isHttps() && $server_port!=80)
) {
$server_url .= ':';
$server_url .= $server_port;
}
}
return $server_url;
return $this->_serviceBaseUrl;
}
/**
* This method checks to see if the request is secured via HTTPS
* This method sets the service base URL used during service URL discovery process.
*
* @return bool true if https, false otherwise
* This is required since phpCAS 1.6.0 to protect the integrity of the authentication.
*
* @since phpCAS 1.6.0
*
* @param $name can be any of the following:
* - A base URL string. The service URL discovery will always use this (protocol,
* hostname and optional port number) without using any external host names.
* - An array of base URL strings. The service URL discovery will check against
* this list before using the auto discovered base URL. If there is no match,
* the first base URL in the array will be used as the default. This option is
* helpful if your PHP website is accessible through multiple domains without a
* canonical name, or through both HTTP and HTTPS.
* - A class that implements CAS_ServiceBaseUrl_Interface. If you need to customize
* the base URL discovery behavior, you can pass in a class that implements the
* interface.
*
* @return void
*/
private function _isHttps()
private function _setServiceBaseUrl($name)
{
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
return ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https');
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTOCOL'])) {
return ($_SERVER['HTTP_X_FORWARDED_PROTOCOL'] === 'https');
} elseif ( isset($_SERVER['HTTPS'])
&& !empty($_SERVER['HTTPS'])
&& strcasecmp($_SERVER['HTTPS'], 'off') !== 0
) {
return true;
if (is_array($name)) {
$this->_serviceBaseUrl = new CAS_ServiceBaseUrl_AllowedListDiscovery($name);
} else if (is_string($name)) {
$this->_serviceBaseUrl = new CAS_ServiceBaseUrl_Static($name);
} else if ($name instanceof CAS_ServiceBaseUrl_Interface) {
$this->_serviceBaseUrl = $name;
} else {
throw new CAS_TypeMismatchException($name, '$name', 'array, string, or CAS_ServiceBaseUrl_Interface object');
}
return false;
}
/**
@@ -4147,7 +4180,7 @@ class CAS_Client
phpCAS::traceBegin();
$lang = $this->getLangObj();
$this->printHTMLHeader($lang->getAuthenticationFailed());
printf(
$this->printf(
$lang->getYouWereNotAuthenticated(), htmlentities($this->getURL()),
isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN']:''
);
+1 -1
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/CookieJar.php
* @category Authentication
+2 -2
View File
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Exception.php
* @category Authentication
@@ -56,4 +56,4 @@ interface CAS_Exception
{
}
?>
?>
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/GracefullTerminationException.php
* @category Authentication
@@ -83,4 +83,4 @@ implements CAS_Exception
}
}
?>
?>
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/InvalidArgumentException.php
* @category Authentication
@@ -43,4 +43,4 @@ implements CAS_Exception
{
}
?>
?>
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/Catalan.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/ChineseSimplified.php
* @category Authentication
@@ -111,4 +111,4 @@ class CAS_Languages_ChineseSimplified implements CAS_Languages_LanguageInterface
{
return '服务器 <b>%s</b> 不可用(<b>%s</b>)。';
}
}
}
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/English.php
* @category Authentication
@@ -111,4 +111,4 @@ class CAS_Languages_English implements CAS_Languages_LanguageInterface
{
return 'The service `<b>%s</b>\' is not available (<b>%s</b>).';
}
}
}
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/French.php
* @category Authentication
@@ -113,4 +113,4 @@ class CAS_Languages_French implements CAS_Languages_LanguageInterface
}
}
?>
?>
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/Galego.php
* @category Authentication
@@ -101,7 +101,7 @@ class CAS_Languages_Galego implements CAS_Languages_LanguageInterface
public function getYouWereNotAuthenticated()
{
return '
<p>Non estás autenticado</p><p>Podes volver tentalo facendo click <a href="%s">aquí</a>.</p><p>Se o problema persiste debería contactar con el <a href="mailto:%s">administrador deste sitio</a>.</p>';
<p>Non estás autenticado</p><p>Podes volver tentalo facendo click <a href="%s">aquí</a>.</p><p>Se o problema persiste debería contactar con el <a href="mailto:%s">administrador deste sitio</a>.</p>';
}
/**
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/German.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/Greek.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/Japanese.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/LanguageInterface.php
* @category Authentication
@@ -93,4 +93,4 @@ interface CAS_Languages_LanguageInterface
public function getServiceUnavailable();
}
?>
?>
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/Portuguese.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Language/Spanish.php
* @category Authentication
@@ -18,7 +18,7 @@
* limitations under the License.
*
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/OutOfSequenceBeforeAuthenticationCallException.php
* @category Authentication
@@ -18,7 +18,7 @@
* limitations under the License.
*
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/OutOfSequenceBeforeClientException.php
* @category Authentication
@@ -18,7 +18,7 @@
* limitations under the License.
*
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/OutOfSequenceBeforeProxyException.php
* @category Authentication
@@ -18,7 +18,7 @@
* limitations under the License.
*
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/OutOfSequenceException.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/PGTStorage/AbstractStorage.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/PGTStorage/Db.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/PGTStorage/AbstractStorage.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Abstract.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Exception.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Http.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Http/Abstract.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Http/Get.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Http/Post.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Imap.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxiedService/Testabel.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxyChain.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxyChain/AllowedList.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxyChain/Any.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxyChain/Interface.php
* @category Authentication
@@ -50,4 +50,4 @@ interface CAS_ProxyChain_Interface
*/
public function matches(array $list);
}
}
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/ProxyChain/Trusted.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @class CAS/ProxyTicketException.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Request/AbstractRequest.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Request/AbstractRequest.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Request/CurlRequest.php
* @category Authentication
@@ -106,14 +106,7 @@ implements CAS_Request_RequestInterface
*********************************************************/
$ch = curl_init($this->url);
if (version_compare(PHP_VERSION, '5.1.3', '>=')) {
//only avaible in php5
curl_setopt_array($ch, $this->_curlOptions);
} else {
foreach ($this->_curlOptions as $key => $value) {
curl_setopt($ch, $key, $value);
}
}
curl_setopt_array($ch, $this->_curlOptions);
/*********************************************************
* Set SSL configuration
@@ -167,6 +160,11 @@ implements CAS_Request_RequestInterface
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postBody);
}
/*********************************************************
* Set User Agent
*********************************************************/
curl_setopt($ch, CURLOPT_USERAGENT, 'phpCAS/' . phpCAS::getVersion());
return $ch;
}
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Request/Exception.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Request/MultiRequestInterface.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Request/RequestInterface.php
* @category Authentication
@@ -0,0 +1,152 @@
<?php
/**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 7
*
* @file CAS/ServiceBaseUrl/AllowedListDiscovery.php
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
/**
* Class that gets the service base URL of the PHP server by HTTP header
* discovery and allowlist check. This is used to generate service URL
* and PGT callback URL.
*
* @class CAS_ServiceBaseUrl_AllowedListDiscovery
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
class CAS_ServiceBaseUrl_AllowedListDiscovery
extends CAS_ServiceBaseUrl_Base
{
private $_list = array();
public function __construct($list) {
if (is_array($list)) {
if (count($list) === 0) {
throw new CAS_InvalidArgumentException('$list should not be empty');
}
foreach ($list as $value) {
$this->allow($value);
}
} else {
throw new CAS_TypeMismatchException($list, '$list', 'array');
}
}
/**
* Add a base URL to the allowed list.
*
* @param $url protocol, host name and port to add to the allowed list
*
* @return void
*/
public function allow($url)
{
$this->_list[] = $this->removeStandardPort($url);
}
/**
* Check if the server name is allowed by configuration.
*
* @param $name server name to check
*
* @return bool whether the allowed list contains the server name
*/
protected function isAllowed($name)
{
return in_array($name, $this->_list);
}
/**
* Discover the server name through HTTP headers.
*
* We read:
* - HTTP header X-Forwarded-Host
* - HTTP header X-Forwarded-Server and X-Forwarded-Port
* - HTTP header Host and SERVER_PORT
* - PHP SERVER_NAME (which can change based on the HTTP server used)
*
* The standard port will be omitted (80 for HTTP, 443 for HTTPS).
*
* @return string the discovered, unsanitized server protocol, hostname and port
*/
protected function discover()
{
$isHttps = $this->isHttps();
$protocol = $isHttps ? 'https' : 'http';
$protocol .= '://';
if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
// explode the host list separated by comma and use the first host
$hosts = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST']);
// see rfc7239#5.3 and rfc7230#2.7.1: port is in HTTP_X_FORWARDED_HOST if non default
return $protocol . $hosts[0];
} else if (!empty($_SERVER['HTTP_X_FORWARDED_SERVER'])) {
$server_url = $_SERVER['HTTP_X_FORWARDED_SERVER'];
} else {
if (empty($_SERVER['SERVER_NAME'])) {
$server_url = $_SERVER['HTTP_HOST'];
} else {
$server_url = $_SERVER['SERVER_NAME'];
}
}
if (!strpos($server_url, ':')) {
if (empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
$server_port = $_SERVER['SERVER_PORT'];
} else {
$ports = explode(',', $_SERVER['HTTP_X_FORWARDED_PORT']);
$server_port = $ports[0];
}
$server_url .= ':';
$server_url .= $server_port;
}
return $protocol . $server_url;
}
/**
* Get PHP server base URL.
*
* @return string the server protocol, hostname and port
*/
public function get()
{
phpCAS::traceBegin();
$result = $this->removeStandardPort($this->discover());
phpCAS::trace("Discovered server base URL: " . $result);
if ($this->isAllowed($result)) {
phpCAS::trace("Server base URL is allowed");
phpCAS::traceEnd(true);
} else {
$result = $this->_list[0];
phpCAS::trace("Server base URL is not allowed, using default: " . $result);
phpCAS::traceEnd(false);
}
return $result;
}
}
@@ -0,0 +1,98 @@
<?php
/**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 7
*
* @file CAS/ServiceBaseUrl/Base.php
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
/**
* Base class of CAS/ServiceBaseUrl that implements isHTTPS method.
*
* @class CAS_ServiceBaseUrl_Base
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
abstract class CAS_ServiceBaseUrl_Base
implements CAS_ServiceBaseUrl_Interface
{
/**
* Get PHP server name.
*
* @return string the server hostname and port of the server
*/
abstract public function get();
/**
* Check whether HTTPS is used.
*
* This is used to construct the protocol in the URL.
*
* @return bool true if HTTPS is used
*/
public function isHttps() {
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
return ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https');
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTOCOL'])) {
return ($_SERVER['HTTP_X_FORWARDED_PROTOCOL'] === 'https');
} elseif ( isset($_SERVER['HTTPS'])
&& !empty($_SERVER['HTTPS'])
&& strcasecmp($_SERVER['HTTPS'], 'off') !== 0
) {
return true;
}
return false;
}
/**
* Remove standard HTTP and HTTPS port for discovery and allowlist input.
*
* @param $url URL as https://domain:port without trailing slash
* @return standardized URL, or the original URL
* @throws CAS_InvalidArgumentException if the URL does not include the protocol
*/
protected function removeStandardPort($url) {
if (strpos($url, "://") === false) {
throw new CAS_InvalidArgumentException(
"Configured base URL should include the protocol string: " . $url);
}
$url = rtrim($url, '/');
if (strpos($url, "https://") === 0 && substr_compare($url, ':443', -4) === 0) {
return substr($url, 0, -4);
}
if (strpos($url, "http://") === 0 && substr_compare($url, ':80', -3) === 0) {
return substr($url, 0, -3);
}
return $url;
}
}
@@ -0,0 +1,61 @@
<?php
/**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 7
*
* @file CAS/ServerHostname/Interface.php
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
/**
* An interface for classes that gets the server name of the PHP server.
* This is used to generate service URL and PGT callback URL.
*
* @class CAS_ServiceBaseUrl_Interface
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
interface CAS_ServiceBaseUrl_Interface
{
/**
* Get PHP HTTP protocol and server name.
*
* @return string protocol, server hostname, and optionally port,
* without trailing slash (https://localhost:8443)
*/
public function get();
/**
* Check whether HTTPS is used.
*
* This is used to construct the protocol in the URL.
*
* @return bool true if HTTPS is used
*/
public function isHttps();
}
@@ -0,0 +1,69 @@
<?php
/**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 7
*
* @file CAS/ServiceBaseUrl/Static.php
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
/**
* Class that gets the server name of the PHP server by statically set
* hostname and port. This is used to generate service URL and PGT
* callback URL.
*
* @class CAS_ServiceBaseUrl_Static
* @category Authentication
* @package PhpCAS
* @author Henry Pan <git@phy25.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://wiki.jasig.org/display/CASC/phpCAS
*/
class CAS_ServiceBaseUrl_Static
extends CAS_ServiceBaseUrl_Base
{
private $_name = null;
public function __construct($name) {
if (is_string($name)) {
$this->_name = $this->removeStandardPort($name);
} else {
throw new CAS_TypeMismatchException($name, '$name', 'string');
}
}
/**
* Get the server name through static config.
*
* @return string the server hostname and port of the server configured
*/
public function get()
{
phpCAS::traceBegin();
phpCAS::trace("Returning static server name: " . $this->_name);
phpCAS::traceEnd(true);
return $this->_name;
}
}
@@ -18,7 +18,7 @@
* limitations under the License.
*
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/Session/PhpSession.php
* @category Authentication
@@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP Version 5
* PHP Version 7
*
* @file CAS/InvalidArgumentException.php
* @category Authentication
+19 -1
View File
@@ -2,6 +2,24 @@
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitad79bd4bf22603c3738880e9bc6fc25d::getLoader();
return ComposerAutoloaderInit8c729390e3f26f25c6e8fe4b9504a4d9::getLoader();
+9 -7
View File
@@ -21,12 +21,14 @@ use Composer\Semver\VersionParser;
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;
@@ -37,7 +39,7 @@ class InstalledVersions
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();
@@ -241,7 +243,7 @@ class InstalledVersions
/**
* @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
@@ -255,7 +257,7 @@ class InstalledVersions
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@@ -278,7 +280,7 @@ class InstalledVersions
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
@@ -301,7 +303,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
@@ -311,7 +313,7 @@ class InstalledVersions
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
+5 -1
View File
@@ -2,7 +2,7 @@
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
@@ -51,6 +51,10 @@ return array(
'CAS_Request_Exception' => $vendorDir . '/apereo/phpcas/source/CAS/Request/Exception.php',
'CAS_Request_MultiRequestInterface' => $vendorDir . '/apereo/phpcas/source/CAS/Request/MultiRequestInterface.php',
'CAS_Request_RequestInterface' => $vendorDir . '/apereo/phpcas/source/CAS/Request/RequestInterface.php',
'CAS_ServiceBaseUrl_AllowedListDiscovery' => $vendorDir . '/apereo/phpcas/source/CAS/ServiceBaseUrl/AllowedListDiscovery.php',
'CAS_ServiceBaseUrl_Base' => $vendorDir . '/apereo/phpcas/source/CAS/ServiceBaseUrl/Base.php',
'CAS_ServiceBaseUrl_Interface' => $vendorDir . '/apereo/phpcas/source/CAS/ServiceBaseUrl/Interface.php',
'CAS_ServiceBaseUrl_Static' => $vendorDir . '/apereo/phpcas/source/CAS/ServiceBaseUrl/Static.php',
'CAS_Session_PhpSession' => $vendorDir . '/apereo/phpcas/source/CAS/Session/PhpSession.php',
'CAS_TypeMismatchException' => $vendorDir . '/apereo/phpcas/source/CAS/TypeMismatchException.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+1 -1
View File
@@ -2,7 +2,7 @@
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
+1 -1
View File
@@ -2,7 +2,7 @@
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
+6 -25
View File
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitad79bd4bf22603c3738880e9bc6fc25d
class ComposerAutoloaderInit8c729390e3f26f25c6e8fe4b9504a4d9
{
private static $loader;
@@ -24,31 +24,12 @@ class ComposerAutoloaderInitad79bd4bf22603c3738880e9bc6fc25d
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInitad79bd4bf22603c3738880e9bc6fc25d', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitad79bd4bf22603c3738880e9bc6fc25d', 'loadClassLoader'));
spl_autoload_register(array('ComposerAutoloaderInit8c729390e3f26f25c6e8fe4b9504a4d9', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit8c729390e3f26f25c6e8fe4b9504a4d9', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitad79bd4bf22603c3738880e9bc6fc25d::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8c729390e3f26f25c6e8fe4b9504a4d9::getInitializer($loader));
$loader->register(true);
+8 -4
View File
@@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitad79bd4bf22603c3738880e9bc6fc25d
class ComposerStaticInit8c729390e3f26f25c6e8fe4b9504a4d9
{
public static $prefixLengthsPsr4 = array (
'P' =>
@@ -66,6 +66,10 @@ class ComposerStaticInitad79bd4bf22603c3738880e9bc6fc25d
'CAS_Request_Exception' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/Request/Exception.php',
'CAS_Request_MultiRequestInterface' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/Request/MultiRequestInterface.php',
'CAS_Request_RequestInterface' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/Request/RequestInterface.php',
'CAS_ServiceBaseUrl_AllowedListDiscovery' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/ServiceBaseUrl/AllowedListDiscovery.php',
'CAS_ServiceBaseUrl_Base' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/ServiceBaseUrl/Base.php',
'CAS_ServiceBaseUrl_Interface' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/ServiceBaseUrl/Interface.php',
'CAS_ServiceBaseUrl_Static' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/ServiceBaseUrl/Static.php',
'CAS_Session_PhpSession' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/Session/PhpSession.php',
'CAS_TypeMismatchException' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS/TypeMismatchException.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -75,9 +79,9 @@ class ComposerStaticInitad79bd4bf22603c3738880e9bc6fc25d
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitad79bd4bf22603c3738880e9bc6fc25d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitad79bd4bf22603c3738880e9bc6fc25d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitad79bd4bf22603c3738880e9bc6fc25d::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit8c729390e3f26f25c6e8fe4b9504a4d9::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8c729390e3f26f25c6e8fe4b9504a4d9::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8c729390e3f26f25c6e8fe4b9504a4d9::$classMap;
}, null, ClassLoader::class);
}
+13 -11
View File
@@ -2,29 +2,31 @@
"packages": [
{
"name": "apereo/phpcas",
"version": "1.4.0",
"version_normalized": "1.4.0.0",
"version": "1.6.0",
"version_normalized": "1.6.0.0",
"source": {
"type": "git",
"url": "https://github.com/apereo/phpCAS.git",
"reference": "ea27d122c4c7114006b33d15668c90f1904d53df"
"reference": "f817c72a961484afef95ac64a9257c8e31f063b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/apereo/phpCAS/zipball/ea27d122c4c7114006b33d15668c90f1904d53df",
"reference": "ea27d122c4c7114006b33d15668c90f1904d53df",
"url": "https://api.github.com/repos/apereo/phpCAS/zipball/f817c72a961484afef95ac64a9257c8e31f063b9",
"reference": "f817c72a961484afef95ac64a9257c8e31f063b9",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=7.0.0",
"psr/log": "^1.0.0"
"ext-dom": "*",
"php": ">=7.1.0",
"psr/log": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"monolog/monolog": "^1.0.0",
"phpunit/phpunit": ">=4.8.35 <8"
"monolog/monolog": "^1.0.0 || ^2.0.0",
"phpstan/phpstan": "^1.5",
"phpunit/phpunit": ">=7.5"
},
"time": "2021-05-30T19:53:34+00:00",
"time": "2022-10-31T20:39:27+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -65,7 +67,7 @@
],
"support": {
"issues": "https://github.com/apereo/phpCAS/issues",
"source": "https://github.com/apereo/phpCAS/tree/1.4.0"
"source": "https://github.com/apereo/phpCAS/tree/1.6.0"
},
"install-path": "../apereo/phpcas"
},
+7 -7
View File
@@ -1,40 +1,40 @@
<?php return array(
'root' => array(
'name' => '__root__',
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => NULL,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'name' => '__root__',
'dev' => true,
),
'versions' => array(
'__root__' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => NULL,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'dev_requirement' => false,
),
'apereo/phpcas' => array(
'pretty_version' => '1.4.0',
'version' => '1.4.0.0',
'pretty_version' => '1.6.0',
'version' => '1.6.0.0',
'reference' => 'f817c72a961484afef95ac64a9257c8e31f063b9',
'type' => 'library',
'install_path' => __DIR__ . '/../apereo/phpcas',
'aliases' => array(),
'reference' => 'ea27d122c4c7114006b33d15668c90f1904d53df',
'dev_requirement' => false,
),
'psr/log' => array(
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'dev_requirement' => false,
),
),
+2 -2
View File
@@ -4,8 +4,8 @@
$issues = array();
if (!(PHP_VERSION_ID >= 70000)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.';
if (!(PHP_VERSION_ID >= 70100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
+11 -2
View File
@@ -179,11 +179,20 @@ class auth_plugin_cas extends auth_plugin_ldap {
static $connected = false;
if (!$connected) {
// Form the base URL of the server with just the protocol and hostname.
$serverurl = new moodle_url("/");
$servicebaseurl = $serverurl->get_scheme() ? $serverurl->get_scheme() . "://" : '';
$servicebaseurl .= $serverurl->get_host();
// Add the port if set.
$servicebaseurl .= $serverurl->get_port() ? ':' . $serverurl->get_port() : '';
// Make sure phpCAS doesn't try to start a new PHP session when connecting to the CAS server.
if ($this->config->proxycas) {
phpCAS::proxy($this->config->casversion, $this->config->hostname, (int) $this->config->port, $this->config->baseuri, false);
phpCAS::proxy($this->config->casversion, $this->config->hostname, (int) $this->config->port, $this->config->baseuri,
$servicebaseurl, false);
} else {
phpCAS::client($this->config->casversion, $this->config->hostname, (int) $this->config->port, $this->config->baseuri, false);
phpCAS::client($this->config->casversion, $this->config->hostname, (int) $this->config->port,
$this->config->baseuri, $servicebaseurl, false);
}
// Some CAS installs require SSLv3 that should be explicitly set.
if (!empty($this->config->curl_ssl_version)) {
+2 -1
View File
@@ -3,8 +3,9 @@
<library>
<location>CAS</location>
<name>CAS</name>
<description>phpCAS library to support CAS authentication plugin.</description>
<version>1.6.0</version>
<license>Apache</license>
<version>1.4.0</version>
<licenseversion>2.0</licenseversion>
</library>
</libraries>
+14 -8
View File
@@ -48,11 +48,7 @@ if ($confirmed) {
print_error('cannotfinduser', '', '', $userid);
}
if (!$user->suspended) {
complete_user_login($user);
\core\session\manager::apply_concurrent_login_limit($user->id, session_id());
if ($user->id == $USER->id) {
// Check where to go, $redirect has a higher preference.
if (empty($redirect) and !empty($SESSION->wantsurl) ) {
$redirect = $SESSION->wantsurl;
@@ -69,14 +65,24 @@ if ($confirmed) {
$PAGE->set_heading($COURSE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
echo "<h3>".get_string("thanks").", ". fullname($user) . "</h3>\n";
echo "<p>".get_string("confirmed")."</p>\n";
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
// If $wantsurl and $redirect are empty, then the button will navigate the identical user to the dashboard.
if ($user->id == $USER->id) {
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
} else if (!isloggedin() || isguestuser()) {
echo $OUTPUT->single_button(get_login_url(), get_string('login'));
} else {
echo $OUTPUT->single_button("$CFG->wwwroot/login/logout.php", get_string('logout'));
}
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
} else {
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
// Avoid error if logged-in user visiting the page.
if (!isloggedin()) {
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
}
}
redirect("$CFG->wwwroot/");
@@ -16,26 +16,15 @@ Feature: availability_completion
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name | completion |
| page | C1 | Page 1 | 1 |
| page | C1 | Page 2 | |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with a completion tickbox.
And I add a "Page" to section "1" and I fill the form with:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
| Completion tracking | 1 |
# And another one that depends on it (hidden otherwise).
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
Given I am on the "Page 2" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
@@ -44,9 +33,7 @@ Feature: availability_completion
And I press "Save and return to course"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# Page 2 should not appear yet.
Then I should not see "Page 2" in the "region-main" "region"
@@ -58,27 +45,12 @@ Feature: availability_completion
@javascript
Scenario: Test completion and course cache rebuild
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | forum 1 | forum 1 | C1 | forum1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I open "forum 1" actions menu
And I click on "Edit settings" "link" in the "forum 1" activity
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| completionview | 1 |
| completionpostsenabled | 1 |
| completionposts | 2 |
And I press "Save and return to course"
And I add a new discussion to "forum 1" forum with:
| Subject | Forum post 1 |
| Message | This is the body |
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
| activity | name | course | idnumber | completion | completionview | completionpostsenabled | completionposts |
| forum | forum 1 | C1 | forum1 | 2 | 1 | 1 | 2 |
And the following "mod_forum > discussions" exist:
| forum | subject | message |
| forum1 | Forum post 1 | This is the body |
And I am on the "Page 2" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
@@ -87,25 +59,18 @@ Feature: availability_completion
| Required completion status | must be marked complete |
| cm | forum 1 |
And I press "Save and return to course"
And I log out
And I log in as "student1"
When I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# Page 2 should not appear yet.
Then I should not see "Page 2" in the "region-main" "region"
And I click on "forum 1" "link" in the "region-main" "region"
# Page 2 should not appear yet.
And I should not see "Page 2" in the "region-main" "region"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "forum 1" "forum activity editing" page
And I am on the "forum 1" "forum activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the following fields to these values:
| completionpostsenabled | 0 |
And I press "Save and display"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" "course" page logged in as "student1"
And I click on "forum 1" "link" in the "region-main" "region"
And I am on "Course 1" course homepage
And I should see "Page 2" in the "region-main" "region"
@@ -18,21 +18,17 @@ Feature: Confirm that conditions on completion no longer cause a bug
@javascript
Scenario: Multiple completion conditions on glossary
# Set up course.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" "course" page logged in as "teacher1"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Enable completion tracking" to "Yes"
And I press "Save and display"
And I turn editing mode on
# Add a couple of Pages with manual completion.
And I add a "Page" to section "1" and I fill the form with:
| Name | Page1 |
| Page content | x |
And I add a "Page" to section "1" and I fill the form with:
| Name | Page2 |
| Page content | x |
And the following "activities" exist:
| activity | course | name | completion |
| page | C1 | Page1 | 1 |
| page | C1 | Page2 | 1 |
# Add a Glossary.
When I add a "Glossary" to section "1"
@@ -16,19 +16,15 @@ Feature: availability_date
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name |
| page | C1 | Page 1 |
| page | C1 | Page 2 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with a date condition that does match (from the past).
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
Given I am on the "Page 1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -37,11 +33,7 @@ Feature: availability_date
And I press "Save and return to course"
# Add a Page with a date condition that doesn't match (until the past).
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
And I am on the "Page 2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -51,9 +43,7 @@ Feature: availability_date
And I press "Save and return to course"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# Page 1 should appear, but page 2 does not.
Then I should see "Page 1" in the "region-main" "region"
@@ -17,26 +17,17 @@ Feature: availability_grade
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
# Add an assignment.
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | A1 |
| intro | x |
| assignsubmission_onlinetext_enabled | 1 |
And the following "activities" exist:
| activity | course | name | assignsubmission_onlinetext_enabled |
| assign | C1 | A1 | 1 |
| page | C1 | P1 | |
| page | C1 | P2 | |
| page | C1 | P3 | |
| page | C1 | P4 | |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with a grade condition for 'any grade'.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
Given I am on the "P2" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
@@ -45,11 +36,7 @@ Feature: availability_grade
And I press "Save and return to course"
# Add a Page with a grade condition for 50%.
And I add a "Page" to section "3"
And I set the following fields to these values:
| Name | P3 |
| Description | x |
| Page content | x |
And I am on the "P3" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
@@ -62,23 +49,16 @@ Feature: availability_grade
And I press "Save and return to course"
# Check if disabling a part of the restriction is get saved.
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I am on the "P3" "page activity editing" page
And I expand all fieldsets
And I click on "max" "checkbox" in the ".availability-item" "css_element"
And I press "Save and return to course"
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I expand all fieldsets
And I am on the "P3" "page activity editing" page
And the field "Maximum grade percentage (exclusive)" matches value ""
And I am on "Course 1" course homepage
# Add a Page with a grade condition for 10%.
And I add a "Page" to section "4"
And I set the following fields to these values:
| Name | P4 |
| Description | x |
| Page content | x |
And I am on the "P4" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
@@ -88,8 +68,6 @@ Feature: availability_grade
And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course"
And I log out
# Log in as student without a grade yet.
When I am on the "A1" "assign activity" page logged in as student1
@@ -104,7 +82,6 @@ Feature: availability_grade
And I should not see "P3" in the "region-main" "region"
And I should not see "P4" in the "region-main" "region"
And I should see "A1" in the "region-main" "region"
And I log out
# Log back in as teacher.
When I am on the "A1" "assign activity" page logged in as teacher1
@@ -143,12 +120,8 @@ Feature: availability_grade
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I set the field "Grade" to "A-One"
@@ -16,15 +16,16 @@ Feature: availability_group
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name |
| page | C1 | P1 |
| page | C1 | P2 |
| page | C1 | P3 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Start to add a Page. If there aren't any groups, there's no Group option.
And I add a "Page" to section "1"
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Group" "button" should not exist in the "Add restriction..." "dialogue"
@@ -37,8 +38,7 @@ Feature: availability_group
| G2 | C1 | GI2 |
# This step used to be 'And I follow "C1"', but Chrome thinks the breadcrumb
# is not clickable, so we'll go via the home page instead.
And I am on "Course 1" course homepage
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Group" "button" should exist in the "Add restriction..." "dialogue"
@@ -47,18 +47,10 @@ Feature: availability_group
Given I click on "Group" "button" in the "Add restriction..." "dialogue"
And I set the field "Group" to "(Any group)"
And I click on ".availability-item .availability-eye img" "css_element"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Save and return to course" "button"
# Page P2 with group G1.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
And I am on the "P2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Group" "button" in the "Add restriction..." "dialogue"
@@ -67,11 +59,7 @@ Feature: availability_group
And I click on "Save and return to course" "button"
# Page P3 with group G2
And I add a "Page" to section "3"
And I set the following fields to these values:
| Name | P3 |
| Description | x |
| Page content | x |
And I am on the "P3" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Group" "button" in the "Add restriction..." "dialogue"
@@ -80,9 +68,7 @@ Feature: availability_group
And I click on "Save and return to course" "button"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# No pages should appear yet.
Then I should not see "P1" in the "region-main" "region"
@@ -93,8 +79,6 @@ Feature: availability_group
Given the following "group members" exist:
| user | group |
| student1 | GI1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
# P1 (any groups) and P2 should show but not P3.
@@ -113,19 +97,12 @@ Feature: availability_group
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "Group" "button" in the "Add restriction..." "dialogue"
And I set the field "Group" to "G-One"
And I click on "Save and return to course" "button"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
@@ -22,15 +22,16 @@ Feature: availability_grouping
And the following "group members" exist:
| user | group |
| student1 | GI1 |
# Basic setup.
And the following "activities" exist:
| activity | course | name |
| page | C1 | P1 |
| page | C1 | P2 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Start to add a Page. If there aren't any groupings, there's no Grouping option.
And I add a "Page" to section "1"
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Grouping" "button" should not exist in the "Add restriction..." "dialogue"
@@ -44,7 +45,7 @@ Feature: availability_grouping
| name | course | idnumber |
| GX1 | C1 | GXI1 |
| GX2 | C1 | GXI2 |
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
Then "Grouping" "button" should exist in the "Add restriction..." "dialogue"
@@ -53,18 +54,10 @@ Feature: availability_grouping
Given I click on "Grouping" "button"
And I set the field "Grouping" to "GX1"
And I click on ".availability-item .availability-eye img" "css_element"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Save and return to course" "button"
# Page P2 with grouping GX2.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
And I am on the "P2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grouping" "button"
@@ -73,21 +66,17 @@ Feature: availability_grouping
And I click on "Save and return to course" "button"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# No pages should appear yet.
Then I should not see "P1" in the "region-main" "region"
And I should not see "P2" in the "region-main" "region"
# Add group to grouping and log out/in again.
And I log out
And the following "grouping groups" exist:
| grouping | group |
| GXI1 | GI1 |
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" "course" page logged in as "student1"
# P1 should show but not B2.
Then I should see "P1" in the "region-main" "region"
@@ -129,14 +118,10 @@ Feature: availability_grouping
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I open "Test assign" actions menu
And I choose "Edit settings" in the open action menu
And I am on the "Test assign" "assign activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I press "Add group/grouping access restriction"
And I press "Save and return to course"
And I log out
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
@@ -16,19 +16,15 @@ Feature: availability_profile
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name |
| page | C1 | P1 |
| page | C1 | P2 |
@javascript
Scenario: Test condition
# Basic setup.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
@@ -38,11 +34,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Add
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | P2 |
| Description | x |
| Page content | x |
And I am on the "P2" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
@@ -52,9 +44,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Log back in as student.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" "course" page logged in as "student1"
# I see P1 but not P2.
Then I should see "P1" in the "region-main" "region"
@@ -72,12 +62,7 @@ Feature: availability_profile
And I click on "Update profile" "button"
# Set Page activity which has requirement on this field.
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I am on the "P1" "page activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
@@ -94,9 +79,7 @@ Feature: availability_profile
And the field "Value to compare against" matches value "Bananaman"
# Log out and back in as student. Should be able to see activity.
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" "course" page logged in as "student1"
Then I should see "P1" in the "region-main" "region"
@javascript
@@ -110,14 +93,8 @@ Feature: availability_profile
# The activity names filter is enabled because it triggered a bug in older versions.
And the "activitynames" filter is "on"
And the "activitynames" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I add a "Page" to section "1"
And I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I set the following fields to these values:
| Name | P1 |
| Description | x |
| Page content | x |
And I click on "Add restriction..." "button"
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
@@ -34,19 +34,16 @@ Feature: display_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | section | name |
| page | C1 | 1 | Page 1 |
| page | C1 | 2 | Page 2 |
| page | C1 | 3 | Page 3 |
@javascript
Scenario: Activity availability display
# Set up.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add a Page with 1 restriction.
When I add a "Page" to section "1"
And I set the following fields to these values:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
Given I am on the "Page 1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -55,12 +52,8 @@ Feature: display_availability
And I set the field "x[month]" to "March"
And I press "Save and return to course"
# Add a Page with 2 restrictions - one is set to Hide on course page if failed.
And I add a "Page" to section "2"
And I set the following fields to these values:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
# Add a Page with 2 restrictions - one is set to hide from students if failed.
And I am on the "Page 2" "page activity editing" page
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Date" "button" in the "Add restriction..." "dialogue"
@@ -75,12 +68,6 @@ Feature: display_availability
And I set the field "Method of comparison" to "is equal to"
And I press "Save and return to course"
# Add another Page with no restrictions.
And I add a "Page" to section "3" and I fill the form with:
| Name | Page 3 |
| Description | Test |
| Page content | Test |
# Page 1 should show in single-line format, showing the date
Then I should see "Available until" in the "#section-1 .availabilityinfo" "css_element"
And I should see "2013" in the "#section-1 .availabilityinfo" "css_element"
@@ -98,9 +85,7 @@ Feature: display_availability
And "#section-3 .availabilityinfo" "css_element" should not exist
# Change to student view.
Given I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "C1" "Course" page logged in as "student1"
# Page 1 display still there but should not be a link.
Then I should see "Page 1" in the "#section-1" "css_element"
@@ -119,8 +104,8 @@ Feature: display_availability
@javascript
Scenario: Section availability display
# Set up.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Given I am on the "C1" "Course" page logged in as "teacher1"
And I turn editing mode on
# Add a restriction to section 1 (visible to students).
When I edit the section "1"
@@ -144,29 +129,13 @@ Feature: display_availability
# This is necessary because otherwise it fails in Chrome, see MDL-44959
And I am on "Course 1" course homepage
# Add Pages to each section.
And I add a "Page" to section "1" and I fill the form with:
| Name | Page 1 |
| Description | Test |
| Page content | Test |
And I add a "Page" to section "2" and I fill the form with:
| Name | Page 2 |
| Description | Test |
| Page content | Test |
And I add a "Page" to section "3" and I fill the form with:
| Name | Page 3 |
| Description | Test |
| Page content | Test |
# Check display
Then I should see "Available until" in the "#section-1 .availabilityinfo" "css_element"
And I should see "Available until" in the "#section-2 .availabilityinfo" "css_element"
And I should see "hidden otherwise" in the "#section-2 .availabilityinfo" "css_element"
# Change to student view.
Given I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" "Course" page logged in as "student1"
# The contents of both sections should be hidden.
Then I should not see "Page 1" in the "region-main" "region"
@@ -27,6 +27,10 @@ Feature: edit_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | forum |
| course | C1 |
| name | MyForum |
Scenario: Confirm the 'enable availability' option is working
Given the following config values are set as admin:
@@ -55,12 +59,8 @@ Feature: edit_availability
| activity | page |
| course | C1 |
| idnumber | 0002 |
| section | 1 |
| name | Page2 |
| intro | pageintro |
And I am on "Course 1" course homepage
And I follow "Page2"
And I navigate to "Settings" in current page administration
And I am on the "Page2" "page activity editing" page
Then "Restrict access" "fieldset" should exist
Given I am on "Course 1" course homepage
@@ -70,9 +70,12 @@ Feature: edit_availability
@javascript
Scenario: Edit availability using settings in activity form
# Set up.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "1"
Given the following "activity" exists:
| activity | page |
| course | C1 |
| section | 1 |
| name | P1 |
And I am on the "P1" "page activity editing" page logged in as "teacher1"
And I expand all fieldsets
Then I should see "None" in the "Restrict access" "fieldset"
@@ -178,9 +181,7 @@ Feature: edit_availability
# Button does not exist when conditional access restrictions are turned off.
Given the following config values are set as admin:
| enableavailability | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1"
And I am on the "MyForum" "forum activity editing" page logged in as admin
When I expand all fieldsets
Then "Add group/grouping access restriction" "button" should not exist
@@ -190,12 +191,7 @@ Feature: edit_availability
Given the following "groupings" exist:
| name | course | idnumber |
| GX1 | C1 | GXI1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1"
And I set the following fields to these values:
| Forum name | MyForum |
| Description | x |
And I am on the "MyForum" "forum activity editing" page logged in as admin
When I expand all fieldsets
Then the "Add group/grouping access restriction" "button" should be disabled
@@ -20,13 +20,13 @@ Feature: Import course's contents into another course
Scenario: Import course's contents to another course
Given I log in as "teacher1"
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| data | Test database name | Test database description | C1 | database1 | 2 |
| forum | Test forum name | Test forum name description | C1 | forum1 | 1 |
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And I add the "Recent blog entries" block
And I turn editing mode off
| activity | name | course | idnumber |
| data | Test database name | C1 | database1 |
| forum | Test forum name | C1 | forum1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
| blog_recent | Course | C1 | course-view-* | side-pre |
When I import "Course 1" course into "Course 2" course using this options:
Then I should see "Test database name"
And I should see "Test forum name"
@@ -12,16 +12,16 @@ Feature: Restore Moodle 2 course backups
| Course 3 | C3 | 0 | topics | 2 | 0 |
| Course 4 | C4 | 0 | topics | 20 | 0 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | section | externalurl |
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
| data | C3 | data1 | Test database name | Database description | 2 | |
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
| activity | course | idnumber | name | intro | section | externalurl |
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
| data | C3 | data1 | Test database name | Database description | 2 | |
| forum | C1 | 0001 | Test forum name | | 1 | |
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_modules | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And I add the "Activities" block
@javascript
Scenario: Restore a course in another existing course
@@ -63,10 +63,11 @@ Feature: Restore Moodle 2 course backups
Scenario: Restore a backup into the same course removing it's contents before that
When I backup "Course 1" course using this options:
| Confirmation | Filename | test_backup.mbz |
And I am on "Course 1" course homepage
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum post backup name |
| Description | Test forum post backup description |
And the following "activity" exists:
| activity | forum |
| course | C1 |
| section | 1 |
| name | Test forum post backup name |
And I am on the "Course 1" "restore" page
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
| Schema | Section 3 | 0 |
+2 -2
View File
@@ -65,10 +65,10 @@ class backpack_api2p1 {
protected $backpackapiversion;
/** @var issuer The OAuth2 Issuer for this backpack */
protected issuer $issuer;
protected $issuer;
/** @var endpoint The apiBase endpoint */
protected endpoint $apibase;
protected $apibase;
/**
* backpack_api2p1 constructor.
@@ -21,8 +21,10 @@ Feature: The activity results block doesn't display student scores for unsupport
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber | assignsubmission_file_enabled |
| assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
And I add the "Activity results" block
And I configure the "Activity results" block
And I set the following fields to these values:
| config_showbest | 1 |
@@ -30,8 +32,7 @@ Feature: The activity results block doesn't display student scores for unsupport
| config_gradeformat | Percentages |
| config_nameformat | Display full names |
And I press "Save changes"
When I follow "Test assignment"
And I navigate to "Settings" in current page administration
When I am on the "Test assignment" "assign activity editing" page
And I set the following fields to these values:
| id_grade_modgrade_type | None |
And I press "Save and return to course"
@@ -21,8 +21,6 @@ Feature: The activity results block can have administrator set defaults
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
@@ -50,8 +48,10 @@ Feature: The activity results block can have administrator set defaults
| config_showbest_locked | 1 | block_activity_results |
| config_showworst | 0 | block_activity_results |
| config_showworst_locked | 1 | block_activity_results |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
And I add the "Activity results" block
When I configure the "Activity results" block
And the following fields match these values:
| config_showbest | 0 |
@@ -14,13 +14,10 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Latest badges" block
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| badges | System | 1 | site-index | side-pre |
And I am on the "Course 1" course page logged in as teacher1
# Issue badge 1 of 2
And I navigate to "Badges > Add a new badge" in current page administration
And I set the following fields to these values:
@@ -37,7 +34,5 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
And I press "Award badge"
And I log out
When I log in as "teacher1"
And I am on site homepage
When I am on site homepage
Then I should see "Badge 1" in the "Latest badges" "block"
@@ -26,16 +26,12 @@ Feature: Enable Block blog menu in an activity
| idnumber | 0001 |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment 1"
And I add the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -43,16 +39,13 @@ Feature: Enable Block blog menu in an activity
And I press "Save changes"
Then I should see "S1 First Blog"
And I should see "This is my awesome blog!"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Blog entries"
And I should see "S1 First Blog"
And I should see "This is my awesome blog!"
Scenario: Students use the blog menu block to view their blogs about the activity
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -61,10 +54,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -73,8 +63,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -83,17 +72,14 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "View my entries about this Assignment"
Then I should see "S2 First Blog"
And I should not see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Students use the blog menu block to view all blogs about the assignment
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -102,10 +88,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -114,8 +97,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -124,17 +106,14 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "View all entries about this Assignment"
Then I should see "S1 First Blog"
And I should see "S2 First Blog"
And I should not see "S2 Second Blog"
Scenario: Students use the blog menu block to view all their blog entries
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -143,10 +122,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -155,8 +131,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -165,17 +140,14 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
When I follow "Blog entries"
Then I should see "S2 First Blog"
And I should see "S2 Second Blog"
And I should not see "S1 First Blog"
Scenario: Teacher searches for student blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -184,10 +156,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this Assignment!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -196,8 +165,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 Second Blog"
And I should see "My unrelated blog!"
And I should not see "Associated Assignment: Test assignment 1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I am on the "Test assignment 1" "assign activity" page
And I follow "Add an entry about this Assignment"
And I set the following fields to these values:
| Entry title | S2 First Blog |
@@ -206,10 +174,7 @@ Feature: Enable Block blog menu in an activity
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Assignment: Test assignment 1"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
When I am on the "Test assignment 1" "assign activity" page logged in as teacher1
And I set the field "Search" to "First"
And I press "Search"
Then I should see "S1 First Blog"
@@ -18,14 +18,12 @@ Feature: Students can use block blog menu in a course
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Course | C1 | course-view-* | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add a new entry"
When I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -39,8 +37,7 @@ Feature: Students can use block blog menu in a course
And I should see "This is my awesome blog!"
Scenario: Students use the blog menu block to view their blogs about the course
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -49,9 +46,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -76,8 +71,7 @@ Feature: Students can use block blog menu in a course
And I should not see "S1 First Blog"
Scenario: Students use the blog menu block to view all blogs about the course
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -86,9 +80,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -113,8 +105,7 @@ Feature: Students can use block blog menu in a course
And I should not see "S2 Second Blog"
Scenario: Students use the blog menu block to view all their blog entries
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -123,9 +114,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -150,8 +139,7 @@ Feature: Students can use block blog menu in a course
And I should not see "S1 First Blog"
Scenario: Teacher searches for student blogs
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Add an entry about this course"
And I set the following fields to these values:
| Entry title | S1 First Blog |
@@ -160,9 +148,7 @@ Feature: Students can use block blog menu in a course
And I should see "S1 First Blog"
And I should see "This is my awesome blog about this course!"
And I should see "Associated Course: C1"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | S2 Second Blog |
@@ -180,9 +166,7 @@ Feature: Students can use block blog menu in a course
And I should see "S2 First Blog"
And I should see "My course blog is better!"
And I should see "Associated Course: C1"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
And I set the field "Search" to "First"
And I press "Search"
Then I should see "S1 First Blog"
@@ -8,11 +8,9 @@ Feature: Enable Block blog menu on the frontpage
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | System | 1 | site-index | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"

Some files were not shown because too many files have changed in this diff Show More