Compare commits
1100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 367dfbd905 | |||
| b17e52001c | |||
| 153fd875b5 | |||
| a43dc9df02 | |||
| f9f150290f | |||
| 8779cb8b46 | |||
| d7378d19ec | |||
| 6219022575 | |||
| d9ec40f57f | |||
| ea790c7db1 | |||
| f0403cbba2 | |||
| 88b5f9b726 | |||
| 4d0ec2a375 | |||
| 7cb4fb6a88 | |||
| 504317a519 | |||
| 110351a2a6 | |||
| 9599ee24b9 | |||
| 78baa1aaad | |||
| 1f4025a70e | |||
| 7e147392e1 | |||
| b7f0d27621 | |||
| 0428d11d76 | |||
| b5a5a482bd | |||
| 699768ebbc | |||
| 6bd9066b7f | |||
| 6af4e1c8c4 | |||
| a5c41b6a5a | |||
| 0bffc5576e | |||
| 21982b71a6 | |||
| 41a5c34f91 | |||
| d08b6757e6 | |||
| dfeb385672 | |||
| b36064f742 | |||
| 3dfb5e4379 | |||
| 7f9f7ec944 | |||
| 1828849b1e | |||
| ff7253c2c1 | |||
| 52257f15d7 | |||
| 4c1af19cf6 | |||
| 48a2b5ad42 | |||
| 9e8cabd7eb | |||
| e28cc09b24 | |||
| 6282be2fd9 | |||
| e6b8565063 | |||
| bce83e8c76 | |||
| e2bf5eec99 | |||
| 87ab475575 | |||
| 9022696d6d | |||
| 418cc2032b | |||
| 25769ccd61 | |||
| d0e6183436 | |||
| ca3c1ddf40 | |||
| ec9f7c117e | |||
| 7f0984c1f3 | |||
| dc8207c52a | |||
| 4419fe33a5 | |||
| ba0dabcc31 | |||
| 3810ca294d | |||
| f493763e04 | |||
| 3140dc600d | |||
| 30739f6651 | |||
| 071d36c917 | |||
| 0540d3479c | |||
| 721a2de984 | |||
| 78d68eb5b2 | |||
| 5c5cb3ec7e | |||
| b06855297c | |||
| dbd0f586a2 | |||
| eb2a36fb55 | |||
| a45296043e | |||
| 4bf57cbfa6 | |||
| 43d78a231d | |||
| 45d44e7e80 | |||
| ff6bc9fbc2 | |||
| 4bdf76ae71 | |||
| 97feab527e | |||
| 903f3f54ed | |||
| a1fec0e3ce | |||
| e07f4ac436 | |||
| 25a37d70ff | |||
| 5446beaa73 | |||
| cb6281b339 | |||
| 3696a3723e | |||
| 8fa821d514 | |||
| 9bb4b97e3d | |||
| 87c39bf549 | |||
| 91f54796bd | |||
| fd52f257ff | |||
| 94c9630d78 | |||
| 84718c0056 | |||
| 0a16d1722a | |||
| abb8f34ecf | |||
| 8af16cbfdb | |||
| 54c5ce36db | |||
| 0b17d072cf | |||
| cd4469af52 | |||
| 01d0a4f289 | |||
| 8f8f6e7c92 | |||
| 90fe299739 | |||
| bceb6eb9d8 | |||
| 7989f2ee28 | |||
| 78a0f36730 | |||
| b2a48214f8 | |||
| 76d9513015 | |||
| 4d89cba698 | |||
| e8189c3074 | |||
| af17ae8a1b | |||
| 8626d4bc24 | |||
| f0b99a9fec | |||
| fcb9e23701 | |||
| ab496d313c | |||
| 0e53408ad7 | |||
| 4b1f48e2ae | |||
| 5530732c16 | |||
| 5b4e26864a | |||
| 1081ccc99b | |||
| c0ad0e5a98 | |||
| b6db8ab49d | |||
| ce455a9a79 | |||
| b6d3fccd59 | |||
| 78be3cdb8b | |||
| 837588a772 | |||
| f398c77963 | |||
| 2fd2fdbdb9 | |||
| 92d3d576fb | |||
| ef06f7f85b | |||
| e7a5ad8da9 | |||
| d8882ec822 | |||
| e21f0b1042 | |||
| b6057d4afa | |||
| bf18b2aa09 | |||
| db365a121d | |||
| d243cd17c5 | |||
| 01be5c29cc | |||
| 1ac2df9163 | |||
| 800fa68224 | |||
| 4876f94726 | |||
| c5c47d0c43 | |||
| 731f877fdb | |||
| acb417721d | |||
| 60f8f5bf42 | |||
| df18c3141e | |||
| 4edc434002 | |||
| 3ce66e9f7b | |||
| fb3501f935 | |||
| 757d66b504 | |||
| 9861a3997a | |||
| e05e5d132e | |||
| 6488b3be2e | |||
| 748e20f006 | |||
| da0dcaef1b | |||
| 9babd808f8 | |||
| 57c07037a7 | |||
| 2eb862ba18 | |||
| e5c482b517 | |||
| 61c7621b80 | |||
| 595687a2f1 | |||
| 6e2e65e499 | |||
| 997a36bb09 | |||
| 8b03cdac79 | |||
| 6b0bfc914c | |||
| 9f5ceda372 | |||
| d550a1409b | |||
| e56a129d56 | |||
| 9a8d870765 | |||
| be724f381e | |||
| c6a0fc48df | |||
| 61e6471fce | |||
| 3ad11e88b2 | |||
| 156f63c804 | |||
| ca9de648a8 | |||
| 66d6716a02 | |||
| 19906f7074 | |||
| b8dececceb | |||
| 068be51fa0 | |||
| 85a430d5be | |||
| 3b00cdbff0 | |||
| 9e0bad4909 | |||
| b430f84c4c | |||
| 014161956c | |||
| 5f842b21bd | |||
| ca3a97b8c1 | |||
| 5b6af116c1 | |||
| a9fd5db642 | |||
| 2f26b36af3 | |||
| c2fe49c5e7 | |||
| 7df5ccc871 | |||
| cf507be4c0 | |||
| 9e8bc0e590 | |||
| b50965414e | |||
| f2592eb65e | |||
| e9d837a1a2 | |||
| a650e7bb3a | |||
| 974dde3777 | |||
| 0ba544e97d | |||
| 72395f4d2a | |||
| 74780decb8 | |||
| f167056a18 | |||
| 375016e822 | |||
| ec6c6dae3f | |||
| 463b6cbe64 | |||
| 08f4e03f53 | |||
| 593d5992c0 | |||
| 671a35735b | |||
| c7bbf43c12 | |||
| 8dd4116941 | |||
| 821a2a750b | |||
| 4351ce8a6b | |||
| d97feb678a | |||
| 1f49b80193 | |||
| 2edb2fbaf1 | |||
| 7aa8c1329f | |||
| 04f64ffbe0 | |||
| bdc1bb3358 | |||
| 8e42353e0e | |||
| 1ab3830750 | |||
| 45ce915b79 | |||
| 2a28db59c3 | |||
| f18d2309fb | |||
| bc516d11c1 | |||
| 75ee3dfa69 | |||
| 7dac46e80c | |||
| 23cbd7e82b | |||
| e2612a5522 | |||
| 41fd2c3924 | |||
| 7020a2ac33 | |||
| cf3f87a641 | |||
| 2500eb7ead | |||
| 0115262560 | |||
| 7c944b7cbe | |||
| e264752381 | |||
| 075f61025c | |||
| 085fecaf86 | |||
| 970d2432d7 | |||
| 0d8057b119 | |||
| 2786c8fd73 | |||
| e1555199db | |||
| 6defede491 | |||
| 47e1151f92 | |||
| e8dc4c6cb1 | |||
| db8598ca48 | |||
| b0252a5c00 | |||
| 47cc07674c | |||
| 29f26fd747 | |||
| 9c336062b7 | |||
| 594f4f574a | |||
| 3802128b59 | |||
| 657ed64b03 | |||
| b39a349ec4 | |||
| 8c30f7fc26 | |||
| 81de99d733 | |||
| 7235680eed | |||
| ce5a0d7b65 | |||
| 89719f7030 | |||
| 1d03d41680 | |||
| de161d3c49 | |||
| 509b0c983d | |||
| 877d109b01 | |||
| dc5ea21614 | |||
| 4a08d3bac9 | |||
| f555bfac15 | |||
| 5fb8a656c1 | |||
| bfc8a717df | |||
| b65b99cab8 | |||
| 296f9b6a82 | |||
| 7409a0e99a | |||
| f08318d7fb | |||
| 890cdce488 | |||
| 5a739340da | |||
| 751ad21e9c | |||
| a9a72d76f9 | |||
| 31e0c05036 | |||
| 2a0d5695b3 | |||
| cf9281719f | |||
| 8cde300d8c | |||
| 50d1bd1c2a | |||
| 58cac329b7 | |||
| 011dd960f4 | |||
| 0389288693 | |||
| e5b094bed6 | |||
| 4a0d23143a | |||
| bdd5bba791 | |||
| 1159927f08 | |||
| b9a69f5b1f | |||
| 947e63afb8 | |||
| d221dc7482 | |||
| 14da408e08 | |||
| 4ca9e54f7f | |||
| 154877b2ff | |||
| 303c064224 | |||
| e521d0f799 | |||
| 4d4b237efb | |||
| 727929f1fa | |||
| 26e8b7a96e | |||
| 4d59b9d9fa | |||
| 7c018f428c | |||
| 3c3ff8ace3 | |||
| 70c6b92b97 | |||
| b27229da41 | |||
| 0801278026 | |||
| d9bda8a421 | |||
| 42f8e247d2 | |||
| ed3ee5e357 | |||
| 8b4a8f616f | |||
| f470cf47b7 | |||
| e43202e7a3 | |||
| e70d37080c | |||
| 98d6d9288b | |||
| 1c2ecdd3dd | |||
| 1d94add47e | |||
| dd1ac4af5c | |||
| 9982cf19c9 | |||
| 7d72568ba9 | |||
| 2ad6c7b8fe | |||
| c73628d1dc | |||
| d976a7d9dc | |||
| 2683c51739 | |||
| 7262b0c5a9 | |||
| 26be3a96c4 | |||
| 33ca51fbdf | |||
| 642a7105e5 | |||
| 4233e8b7b6 | |||
| f7352c8340 | |||
| 90b7248055 | |||
| 3c13c14e59 | |||
| 0cf15fb3e6 | |||
| c966aa2c71 | |||
| d367b64be3 | |||
| 862dd9d01a | |||
| 675c2419d1 | |||
| 3453faf411 | |||
| 9fcb7001e6 | |||
| 6a9c63b3c4 | |||
| f248698fed | |||
| 5510929c42 | |||
| 8cbaea4f7a | |||
| bb52c312de | |||
| 152fa94009 | |||
| a59462f1a4 | |||
| 8f08bf55d9 | |||
| 85c23c24f6 | |||
| 174e5dfc05 | |||
| 3ed3433efd | |||
| 6cb344928f | |||
| 2c56bea007 | |||
| 6ac70d87d4 | |||
| e58d9e9f8e | |||
| 80f91aad31 | |||
| fa1df4db7b | |||
| ce499284a0 | |||
| 5359b97581 | |||
| f3f60456ff | |||
| e0e1d29889 | |||
| 42ce3dfc9f | |||
| 71338fc369 | |||
| 7aae797ec1 | |||
| c5749e312f | |||
| 17f32ca725 | |||
| 7648eae997 | |||
| 62a29aa8e0 | |||
| 93727c9b8e | |||
| b2681766d7 | |||
| afd38cb133 | |||
| d3fcae7237 | |||
| 6b66913982 | |||
| 68875532e6 | |||
| 519c36a6fb | |||
| 93f30556b3 | |||
| b3f180f91b | |||
| ac76e8c5bf | |||
| 3c4e7ea962 | |||
| 3d83f4255a | |||
| 21e5dd9414 | |||
| 9b6b1f3afa | |||
| 148c0decf6 | |||
| 0df7a3d616 | |||
| 46385c64bd | |||
| 91b890f705 | |||
| 683b038d09 | |||
| a04aa7c7df | |||
| 8e2958d1a1 | |||
| 39d860b52d | |||
| 7c37e6755c | |||
| d21dbfd55d | |||
| 723a084744 | |||
| 1ace15420e | |||
| 1df5e775ff | |||
| b547c1396f | |||
| ffbbe44116 | |||
| 7a7056e0bb | |||
| ab505564c9 | |||
| 527bd0664c | |||
| 6285e5af65 | |||
| 792f362b93 | |||
| db69332665 | |||
| 94a7bfecb0 | |||
| 8665733354 | |||
| a6abb7fda7 | |||
| 380199a948 | |||
| 2da1b09809 | |||
| a75dde8a5c | |||
| 3c98b96d40 | |||
| 3bd8388689 | |||
| 5ceee287f3 | |||
| 319e0b4d9a | |||
| 84bed3d71b | |||
| 381b712d96 | |||
| 87c9582273 | |||
| ae9910b3aa | |||
| 91607e97ed | |||
| 71c7eb7260 | |||
| 5b6037f3ac | |||
| d2ae521e17 | |||
| 11f0eb9979 | |||
| 4e1af8f1b3 | |||
| a68c438d5c | |||
| 9a7b7e38b9 | |||
| 43e57712eb | |||
| 55ebb7277b | |||
| 0ca2898178 | |||
| d1910944e2 | |||
| 257343b354 | |||
| 7989c3edc6 | |||
| accaf2e9f6 | |||
| 15f93e462f | |||
| d628dcedd2 | |||
| 8b42d3bbb7 | |||
| c92a464165 | |||
| 08410ed897 | |||
| aea1aa849b | |||
| fe2f0270d3 | |||
| bd6cea2f98 | |||
| b13b2b54a6 | |||
| 5a16abc079 | |||
| 0dd1864b73 | |||
| c23b03b50c | |||
| c5c150c146 | |||
| a555df3d69 | |||
| 87b270ef6a | |||
| 3f8f8601e2 | |||
| ad0957be6d | |||
| 5bdb86e23b | |||
| cb55f92d17 | |||
| 9c3d643dad | |||
| af053ebd3e | |||
| f241382c56 | |||
| 055d04ad68 | |||
| 02cac21426 | |||
| ee031ca12d | |||
| 2332c5b8da | |||
| a2842bc86c | |||
| 8d0db8766b | |||
| 746be7faee | |||
| 3b117ede45 | |||
| af5f09db42 | |||
| 48988ba271 | |||
| 1060c5998e | |||
| 9f5d13105d | |||
| 777816e6c7 | |||
| 0e0fd96278 | |||
| 5aa3fe9c10 | |||
| 882a1343ab | |||
| cb48f665eb | |||
| 0a786db090 | |||
| e9dec637ff | |||
| 954e74f2dd | |||
| dc3906acce | |||
| 4fc9ea71f9 | |||
| abe58b4a43 | |||
| 662231384d | |||
| c76465c42b | |||
| e2a73d8a93 | |||
| 7764cd6cc7 | |||
| 0a870ce21a | |||
| 55be7faa95 | |||
| 60afff1419 | |||
| 1c8d340d1b | |||
| 31d3c58089 | |||
| 4a900a1e3b | |||
| 2564d898d3 | |||
| cea03e39c7 | |||
| e38e49335c | |||
| 8d137d3be6 | |||
| 766b1926ed | |||
| 842721d87f | |||
| 247147c8dd | |||
| 75108f21ad | |||
| 9fa06fc780 | |||
| ed90d891a1 | |||
| d8f6207bee | |||
| 381fd47442 | |||
| f868caa529 | |||
| 4378a0456e | |||
| f829d4a446 | |||
| b49d086945 | |||
| 0aa07c2fa0 | |||
| 4d15a1932a | |||
| c2540e76e1 | |||
| c3c4013f08 | |||
| 210deee299 | |||
| 9c71a2396b | |||
| 6ba16921db | |||
| 245505f928 | |||
| d086c991ee | |||
| c8c625a0be | |||
| a71dd3f315 | |||
| a40fe0a766 | |||
| b2a39ba822 | |||
| 845c5d725b | |||
| ac12e36125 | |||
| 08a7bbc9ff | |||
| 52b0b2684c | |||
| 7c96968699 | |||
| c629a2ef7f | |||
| d500edf243 | |||
| b666f6f3aa | |||
| f66e4015b8 | |||
| a84533fee3 | |||
| b49beecf63 | |||
| 74b111bc7f | |||
| a8c5a14b7c | |||
| f9ad31d809 | |||
| db26bf99f5 | |||
| e4857c41fb | |||
| 37d9720b15 | |||
| 24e6ae8cc6 | |||
| e31d492145 | |||
| e5708be88c | |||
| c34713bfca | |||
| 364f72aa05 | |||
| 4e5d63c403 | |||
| 79bad718b6 | |||
| 01ed826fff | |||
| d842884534 | |||
| b51bfdd111 | |||
| db47e0ffbb | |||
| ceab443d08 | |||
| 5675d86412 | |||
| ad0d007abd | |||
| 69e5d0ef95 | |||
| f32f831749 | |||
| cdd0bfcc1a | |||
| 6153b68ff9 | |||
| 716f1ef9f1 | |||
| 101fb762f1 | |||
| 368cc39e7e | |||
| 806b78fd12 | |||
| 6c619b41c8 | |||
| f02f53f09b | |||
| c4acc71042 | |||
| a5fe571a1c | |||
| 9fa998f63b | |||
| 4b6776536a | |||
| b7a99c865f | |||
| 059c9be198 | |||
| f132783767 | |||
| 26ee0fa9cd | |||
| d3c653c13f | |||
| 1f6823d18f | |||
| 4d833069bd | |||
| 03b17f7a0d | |||
| 5b549b306d | |||
| 6c9ac19b6f | |||
| 83523cccd6 | |||
| 4846e7e856 | |||
| ad9c1a9966 | |||
| 67c80485b9 | |||
| b764301306 | |||
| 993c547bd6 | |||
| 558bfc50fe | |||
| dc13c4f8a3 | |||
| d485515725 | |||
| f8a7befdd5 | |||
| ad5cbccfd3 | |||
| f07794ae81 | |||
| 9930ae9e6b | |||
| 6bcb0ad140 | |||
| 78066f113a | |||
| e2e91ea8ce | |||
| 3b0b90d5c1 | |||
| ad890b4490 | |||
| ea369699c4 | |||
| 87db2759da | |||
| 6bd4ab8c5e | |||
| c887b2c522 | |||
| 02f54468a8 | |||
| d9316decdd | |||
| 39cc4b9f1a | |||
| 9cd9700ad6 | |||
| 6c9ceb3c2e | |||
| d52eafd9ae | |||
| 14f409f698 | |||
| 762b68827e | |||
| c4257b0ff9 | |||
| 76e4168089 | |||
| a58e869ce2 | |||
| 8798f3049f | |||
| 0d163e9ece | |||
| cb7e142c73 | |||
| 17e05203ff | |||
| 92ac252418 | |||
| c9dc31afe8 | |||
| 493dd6c934 | |||
| a2adf92023 | |||
| 005072a3ef | |||
| 8bed6c33cd | |||
| 0ac7fcd7da | |||
| 8aec60b652 | |||
| d4f4fa2abe | |||
| 7620c403ec | |||
| df1a564fa6 | |||
| e20fd196ce | |||
| fd10b9422d | |||
| 80f7504f86 | |||
| a203cb09be | |||
| 131015e234 | |||
| 8494b4356c | |||
| 3b1bd3405b | |||
| d4e2861046 | |||
| 008809ad21 | |||
| 89a750dbeb | |||
| c0db85f0b2 | |||
| ef02670d09 | |||
| 7764e1afe0 | |||
| 2c36ba5bb8 | |||
| 1f046e1625 | |||
| 31a8a7e4e1 | |||
| 120f722403 | |||
| 2854559b92 | |||
| 696d638772 | |||
| 2e0b0c94f8 | |||
| d6070215b8 | |||
| 7ca5f47dcb | |||
| 008c431636 | |||
| 17e44aad44 | |||
| cad170cba8 | |||
| b215544c31 | |||
| 5d10e3f43d | |||
| 354cd59314 | |||
| 1ede3a6712 | |||
| 8558e34ed5 | |||
| 614b05ec8b | |||
| ed2bc33154 | |||
| 1ab501974f | |||
| 87753e76d1 | |||
| 0b06840128 | |||
| 9abc42b262 | |||
| 90080d990a | |||
| e7fcbec49e | |||
| 1576c4d233 | |||
| 6ac068ae5c | |||
| 7074cb559f | |||
| 9138c1f9a8 | |||
| 98ed0ea1af | |||
| 6abfa47012 | |||
| 59b08215b2 | |||
| c7c1adeb8d | |||
| 9230c9417b | |||
| 23f0f6f72d | |||
| 7eb1d32847 | |||
| fadb4b239b | |||
| f319b5bf61 | |||
| 4a373dbaf9 | |||
| c612f884dc | |||
| b543159952 | |||
| 667fdd514e | |||
| 951f480ab9 | |||
| bcbb41a0fa | |||
| ba39176b59 | |||
| 4305306220 | |||
| 8864d0f442 | |||
| 741162fbbe | |||
| f1e4622ccb | |||
| 4241549aed | |||
| 9e0d96f36b | |||
| 7e5b0b4e9c | |||
| 9be2fc8f19 | |||
| f8cbf4713a | |||
| 1a7d693572 | |||
| 31922db550 | |||
| 3cf94d16ed | |||
| ae471b7ab6 | |||
| f00c241f7d | |||
| cbd20ae8ba | |||
| 7bbe252c59 | |||
| a7d6e5b0f7 | |||
| e4edbb9e0b | |||
| 80895066a2 | |||
| 40385816cd | |||
| 1be6adbd3e | |||
| d416d809a1 | |||
| bf3c381651 | |||
| 9338d432f9 | |||
| b2ef8fc07e | |||
| 53ff8d79ee | |||
| ed55a25fd5 | |||
| c92727ae6b | |||
| 5cc8148eb8 | |||
| 92b2d0f2dd | |||
| ec27637e08 | |||
| 319047dfb1 | |||
| 67145bac78 | |||
| 7675f212ee | |||
| 25e0480339 | |||
| 8a286fda3e | |||
| 5e73ea768b | |||
| fdecc5c6da | |||
| f3e4a7a514 | |||
| f966e024ef | |||
| f3410ae74b | |||
| 7e70535f09 | |||
| 8def180d7a | |||
| e123a4e191 | |||
| df5ee47979 | |||
| b18207cd3a | |||
| f750f104ca | |||
| cc1b52fddf | |||
| e6f1411d72 | |||
| 90f08155c5 | |||
| 24f49eaa7e | |||
| 086617bac8 | |||
| 088f9942ef | |||
| 6befbe8050 | |||
| 62385afcd3 | |||
| b9f7637ea8 | |||
| 5e435e4635 | |||
| 362af1586a | |||
| c8305b464f | |||
| f5303bd518 | |||
| d040f940a2 | |||
| c97ab4b00a | |||
| 5e8720e3a3 | |||
| 3cef39f10a | |||
| 0e938d8e6c | |||
| 6a9781ab1f | |||
| 18ecdd56aa | |||
| f9452850dd | |||
| d2925a9397 | |||
| 537cef4fdd | |||
| 8319d93b45 | |||
| 41a96d7c4d | |||
| 1b88c2ef22 | |||
| 0d4057f406 | |||
| 07182b5324 | |||
| 0070770144 | |||
| 03240ae37b | |||
| 0ee01f0cda | |||
| 23febf1491 | |||
| cf299069d4 | |||
| b3abd77235 | |||
| 45c65f2b7e | |||
| 6ef50f6983 | |||
| 378d834f44 | |||
| 9a1e5c1750 | |||
| 6a691a2dba | |||
| a44d38fc25 | |||
| 826153a73d | |||
| 1e76d6529c | |||
| 6dce2448c4 | |||
| 828a4b2350 | |||
| 8300665144 | |||
| 4ccdd406cb | |||
| fc5711d43c | |||
| 1e35150951 | |||
| af6ca730d4 | |||
| e60154c553 | |||
| b2a2b9af0c | |||
| a3fcc4d416 | |||
| 1809c83ef3 | |||
| 88b5a2a15c | |||
| ee9534257d | |||
| 4b612862c7 | |||
| 75bf99a13c | |||
| fd10cafb1a | |||
| 831a8bae99 | |||
| 36b84580e0 | |||
| 4bb8788c44 | |||
| e8e5f86657 | |||
| be310ffda8 | |||
| cacc23f041 | |||
| 72a4c9a290 | |||
| 5d68b50a62 | |||
| 6a1055bf37 | |||
| 67e43279bb | |||
| 3f4bcbd03a | |||
| 74acff4411 | |||
| d6a54ada6e | |||
| d556c2aeaa | |||
| df313f0e94 | |||
| 4d4ef0e0b8 | |||
| 9717970b60 | |||
| 4f2ae57c31 | |||
| 6266a81cf7 | |||
| d0f6aa914a | |||
| 4c7701a6d9 | |||
| b1d476b800 | |||
| eae483c5a4 | |||
| 22da58c579 | |||
| 9b657e0dec | |||
| 8e6f38a406 | |||
| 537515d8e8 | |||
| 3c5f492e9d | |||
| 1301de5879 | |||
| 87698fefb6 | |||
| 7fd096aa14 | |||
| 78dea37dbc | |||
| 8117a6dc8a | |||
| 866002a1ef | |||
| c4a0e8dab6 | |||
| b3f66a5f13 | |||
| 78fb084d02 | |||
| 08f1de55d0 | |||
| 29949f0031 | |||
| 24dea5f76b | |||
| f5f53ceb7a | |||
| 3638683cdd | |||
| ed1061fd15 | |||
| fab77ea872 | |||
| ebb351fa65 | |||
| c8bf751abf | |||
| fc10786ff1 | |||
| 841c716376 | |||
| ca36c9581f | |||
| c03b88f607 | |||
| abf7820411 | |||
| 6cdd66e3c5 | |||
| 316e201245 | |||
| 54c9dab53b | |||
| c60272d855 | |||
| d7895072ac | |||
| 3a1d81851f | |||
| 3e82837cc0 | |||
| 6f0c99c7a8 | |||
| 7dbf7695da | |||
| 0c64299b01 | |||
| 70f97a5995 | |||
| a9530ec147 | |||
| fe5cf88b17 | |||
| 9f79ed8a3c | |||
| 868d207889 | |||
| c28941370e | |||
| 5c0cd26dbf | |||
| 8e9aa7d060 | |||
| 49cb76f312 | |||
| d91d2fa6d3 | |||
| 20dbeadfb3 | |||
| 8ed24b7dda | |||
| 1ca7a8001b | |||
| 5aab521e4d | |||
| a1332df845 | |||
| eb2d09c49c | |||
| e2c0f78d63 | |||
| d7440e481e | |||
| 5fd7a8cc89 | |||
| 7429a293b7 | |||
| a31fec1556 | |||
| a8cecdc232 | |||
| b0d3c33001 | |||
| b3ede2a6f5 | |||
| a804689232 | |||
| 62e0242116 | |||
| 0321eb66d0 | |||
| 604c996ca6 | |||
| ba7b72a53d | |||
| 077b7e99c1 | |||
| 7099595c4d | |||
| e723db1680 | |||
| 19043b2c61 | |||
| 97b0c002ec | |||
| 3c9367fb62 | |||
| a064e86c8b | |||
| f0cb717a7e | |||
| ed14ae8128 | |||
| 05888cfc84 | |||
| cca1df961b | |||
| fb4f768789 | |||
| 1fda1af9d2 | |||
| 6d338ba5f9 | |||
| 63d4e986d0 | |||
| 9595f6a388 | |||
| c50d4d9039 | |||
| 1a5d7ed12e | |||
| e18bb176e1 | |||
| 42fd053ddc | |||
| d873273749 | |||
| cba3313110 | |||
| 122ea396cf | |||
| 1b068b9049 | |||
| 8069349d65 | |||
| 1de8317f92 | |||
| 0ff7b38264 | |||
| 9fc48040ba | |||
| 1752044872 | |||
| 685ecea312 | |||
| ef90bd2c06 | |||
| bcf99ba3b9 | |||
| 48e385f582 | |||
| f9baa9c1cc | |||
| 564f9b03e6 | |||
| a270bb477a | |||
| 23f4b83ec6 | |||
| 28c5a47afc | |||
| b52e9a106c | |||
| 0d2fdd9cd9 | |||
| 591234f350 | |||
| 1b2f2b82f0 | |||
| 85e21f03a1 | |||
| 864dbb4ae7 | |||
| 247475fc9f | |||
| 2fb18d1cdc | |||
| 74f65d5ef6 | |||
| 3443f0a7b2 | |||
| ab05be1a23 | |||
| 0aba3fd198 | |||
| 2466ff5d77 | |||
| fc0966ba1f | |||
| 83e674cd7f | |||
| 9468a32a8e | |||
| 01cd957389 | |||
| d0d30cb9a0 | |||
| 3bbc55a650 | |||
| 0f1d2d8c94 | |||
| da8b22453c | |||
| d490ba1476 | |||
| 408a5a1b03 | |||
| 0ec5eaa5ca | |||
| e4173bf72a | |||
| 55a96b2f3e | |||
| 1a42831794 | |||
| 571acdabaa | |||
| f7396c7867 | |||
| c1bfa6076c | |||
| f9e8f1118d | |||
| 8d1ea9fbed | |||
| 9197f258b9 | |||
| bbaae076fa | |||
| 7ba21c9f41 | |||
| 8f211852b7 | |||
| 0a1dc0b126 | |||
| 104b23ff7f | |||
| d7355da165 | |||
| 64a985181b | |||
| 9fb2199303 | |||
| 0e4429dfec | |||
| 09a47d4232 | |||
| f39c91312f | |||
| f0769c5367 | |||
| 68199074d8 | |||
| 8807ea9497 | |||
| 60061f9d34 | |||
| 4cbb779866 | |||
| 7add89d356 | |||
| a3faf996f5 | |||
| 1dd6d5a8a2 | |||
| c4020445c4 | |||
| 3b455ec7d2 | |||
| 760f271b07 | |||
| bf28e6d08a | |||
| 13f366f87b | |||
| c9c2c6df00 | |||
| ba1fa71220 | |||
| 08afbd8644 | |||
| 3e1a16bbbc | |||
| 2620831e61 | |||
| 040c22892d | |||
| 43059890b7 | |||
| 03796898f6 | |||
| ecaa25ff09 | |||
| 9a055d09c9 | |||
| c95fff4fa9 | |||
| 324480d4b2 | |||
| 4d4a11fd68 | |||
| 89a8bdc8cc | |||
| 8a2bccf264 | |||
| f697f01e35 | |||
| 976fe7c655 | |||
| e6ecbb498b | |||
| 37e6138a3c | |||
| e7514ae3f1 | |||
| 81f9b42660 | |||
| 7c5bebadf1 | |||
| d1a0531ca4 | |||
| 5f536e23ed | |||
| 16d42c3776 | |||
| ca108ade8d | |||
| 8997698305 | |||
| 9cb996a977 | |||
| 6f7fcae9f2 | |||
| 44089f2cb4 | |||
| 5140419a14 | |||
| d0bc1c59ae | |||
| f3726ba3b2 | |||
| e1079fc4f1 | |||
| a8500a96f8 | |||
| 325bbaaa17 | |||
| 12961dfd4d | |||
| c646026617 | |||
| 6dfa18dff6 | |||
| 269a213980 | |||
| 311a061ce1 | |||
| f152f333d0 | |||
| 24ec651269 | |||
| 8abe956ca8 | |||
| 8e1ae566f2 | |||
| b0b359cd73 | |||
| 1ad395e023 | |||
| b1e07b8879 | |||
| 4d78c38a37 | |||
| bb9cae5afc | |||
| 9051e08619 | |||
| cec1b35f86 | |||
| 2fe45c4a0a | |||
| b40e18c325 | |||
| d72975122f | |||
| 7508d0918f | |||
| a91a3c5c79 | |||
| a30e48bc6a | |||
| 6cb0f10970 | |||
| a0de778c07 | |||
| b866247504 | |||
| 33dc359ccc | |||
| 9b6c468b16 | |||
| de028f7715 | |||
| 4be0a0c1b5 | |||
| 7873f331ea | |||
| f8961f9bc0 | |||
| d0949f39e9 | |||
| 042699bf23 | |||
| 49163d4fb6 | |||
| 6ad9639961 | |||
| 694c70e8e6 | |||
| 4398b01077 | |||
| 95df21e3ae | |||
| 6fe671e94a | |||
| 92fa909b5e | |||
| 7b23572651 | |||
| e9369e5282 | |||
| 74b0c7ac01 | |||
| e01a96ef15 | |||
| 00d69809d4 | |||
| 02d7853dab | |||
| 7f5f0ae62b | |||
| b5a814308a | |||
| f22675fed9 | |||
| 1f45359727 | |||
| 7fe0a5d596 | |||
| e83bdb2c03 | |||
| 3b253287d7 | |||
| bf252c1d4a | |||
| cf0d9e996b | |||
| 670eea76db | |||
| 59359cde79 | |||
| 2794229c55 | |||
| 626caefd89 | |||
| 6880e3bb16 | |||
| ed0dd58cf2 | |||
| 1c52f98506 | |||
| 5aac129459 | |||
| 43efbf3deb | |||
| 408964a73b | |||
| b0c015e156 | |||
| b47138f834 | |||
| 40652b156b | |||
| afa39a8fa8 | |||
| c52128df17 | |||
| c0234d300b | |||
| ddc35e5bd5 | |||
| fb904d1889 | |||
| 5d7850d42e | |||
| 52657c4298 | |||
| bd2930f2b1 | |||
| 6cebd028b9 | |||
| 1e006c3d5f | |||
| d5ebb85dce | |||
| be653a00cc | |||
| a1dfc10135 | |||
| e67dfebaca | |||
| 33a9f3495e | |||
| e1f8632d26 | |||
| 82192c1bd8 | |||
| b59efda13c | |||
| 044f9df97e | |||
| 3743bfe506 | |||
| 90beaec2eb | |||
| f758baa9ac | |||
| 42a5861017 | |||
| c9ddd414c7 | |||
| 6b0ee8e3d7 | |||
| e4db399ca5 | |||
| 43b3cb4230 | |||
| 8bf4dbe31c | |||
| 471a2de79c | |||
| a0ba79ded7 | |||
| 252b76e7aa | |||
| fe6ed5c2c2 | |||
| ea95720fe5 | |||
| 916ad6bf7e | |||
| ef10c059ef | |||
| 770f2e2ab1 | |||
| e364a5368d |
+49
-16
@@ -53,7 +53,17 @@
|
||||
moodle_setlocale();
|
||||
|
||||
/// send mime type and encoding
|
||||
@header('Content-Type: text/plain; charset='.current_charset());
|
||||
if (check_browser_version('MSIE')) {
|
||||
//ugly IE hack to work around downloading instead of viewing
|
||||
@header('Content-Type: text/html; charset='.current_charset());
|
||||
echo "<xmp>"; //<pre> is not good enough for us here
|
||||
} else {
|
||||
//send proper plaintext header
|
||||
@header('Content-Type: text/plain; charset='.current_charset());
|
||||
}
|
||||
|
||||
/// increase memory limit (PHP 5.2 does different calculation, we need more memory now)
|
||||
@raise_memory_limit('128M');
|
||||
|
||||
/// Start output log
|
||||
|
||||
@@ -107,13 +117,27 @@
|
||||
|
||||
}
|
||||
}
|
||||
mtrace("Finished blocks");
|
||||
mtrace('Finished blocks');
|
||||
|
||||
if (!empty($CFG->langcache)) {
|
||||
mtrace('Updating languages cache');
|
||||
get_list_of_languages();
|
||||
}
|
||||
|
||||
mtrace('Removing expired enrolments ...', ''); // See MDL-8785
|
||||
$timenow = time();
|
||||
if ($oldenrolments = get_records_select('role_assignments', "timeend > 0 AND timeend < '$timenow'")) {
|
||||
mtrace(count($oldenrolments).' to delete');
|
||||
foreach ($oldenrolments as $oldenrolment) {
|
||||
if (role_unassign($oldenrolment->roleid, $oldenrolment->userid, 0, $oldenrolment->contextid)) {
|
||||
mtrace("Deleted expired role assignment $oldenrolment->roleid for user $oldenrolment->userid from context $oldenrolment->contextid");
|
||||
}
|
||||
}
|
||||
mtrace('Done');
|
||||
} else {
|
||||
mtrace('none found');
|
||||
}
|
||||
|
||||
|
||||
/// Run all core cron jobs, but not every time since they aren't too important.
|
||||
/// These don't have a timer to reduce load, so we'll use a random number
|
||||
@@ -132,8 +156,8 @@
|
||||
if ($assigns = get_users_longtimenosee($longtime)) {
|
||||
foreach ($assigns as $assign) {
|
||||
if ($context = get_context_instance(CONTEXT_COURSE, $assign->courseid)) {
|
||||
if (role_unassign(0, $assign->userid, 0, $context->id)) {
|
||||
mtrace("Deleted student enrolment for user $assign->userid from course $assign->courseid");
|
||||
if (role_unassign(0, $assign->id, 0, $context->id)) {
|
||||
mtrace("Deleted student enrolment for user $assign->id from course $assign->courseid");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,11 +167,13 @@
|
||||
|
||||
/// Delete users who haven't confirmed within required period
|
||||
|
||||
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
|
||||
if ($users = get_users_unconfirmed($oneweek)) {
|
||||
foreach ($users as $user) {
|
||||
if (delete_records('user', 'id', $user->id)) {
|
||||
mtrace("Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
|
||||
if (!empty($CFG->deleteunconfirmed)) {
|
||||
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
|
||||
if ($users = get_users_unconfirmed($oneweek)) {
|
||||
foreach ($users as $user) {
|
||||
if (delete_records('user', 'id', $user->id)) {
|
||||
mtrace("Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,11 +183,13 @@
|
||||
|
||||
/// Delete users who haven't completed profile within required period
|
||||
|
||||
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
|
||||
if ($users = get_users_not_fully_set_up($oneweek)) {
|
||||
foreach ($users as $user) {
|
||||
if (delete_records('user', 'id', $user->id)) {
|
||||
mtrace("Deleted not fully setup user $user->username ($user->id)");
|
||||
if (!empty($CFG->deleteunconfirmed)) {
|
||||
$oneweek = $timenow - ($CFG->deleteunconfirmed * 3600);
|
||||
if ($users = get_users_not_fully_set_up($oneweek)) {
|
||||
foreach ($users as $user) {
|
||||
if (delete_records('user', 'id', $user->id)) {
|
||||
mtrace("Deleted not fully setup user $user->username ($user->id)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,7 +252,7 @@
|
||||
//Execute backup's cron
|
||||
//Perhaps a long time and memory could help in large sites
|
||||
@set_time_limit(0);
|
||||
@raise_memory_limit("128M");
|
||||
@raise_memory_limit("192M");
|
||||
if (function_exists('apache_child_terminate')) {
|
||||
// if we are running from Apache, give httpd a hint that
|
||||
// it can recycle the process after it's done. Apache's
|
||||
@@ -287,7 +315,7 @@
|
||||
if (!empty($CFG->statsmaxruntime)) {
|
||||
$time = $CFG->statsmaxruntime+(60*30); // add on half an hour just to make sure (it could take that long to break out of the loop)
|
||||
}
|
||||
if (!get_field_sql('SELECT id FROM '.$CFG->prefix.'stats_daily LIMIT 1')) {
|
||||
if (!get_field_sql('SELECT id FROM '.$CFG->prefix.'stats_daily')) {
|
||||
// first run, set another lock. we'll check for this in subsequent runs to set the timeout to later for the normal lock.
|
||||
set_cron_lock('statsfirstrunlock',true,$time,true);
|
||||
$firsttime = true;
|
||||
@@ -330,4 +358,9 @@
|
||||
$difftime = microtime_diff($starttime, microtime());
|
||||
mtrace("Execution took ".$difftime." seconds");
|
||||
|
||||
/// finishe the IE hack
|
||||
if (check_browser_version('MSIE')) {
|
||||
echo "</xmp>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
</PHP_EXTENSIONS>
|
||||
</MOODLE>
|
||||
<MOODLE version="1.7">
|
||||
<UNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unicoderecommended" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="4.1.16">
|
||||
<FEEDBACK>
|
||||
@@ -45,6 +50,42 @@
|
||||
<VENDOR name="postgres" version="7.4" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="9.0" />
|
||||
</DATABASE>
|
||||
<PHP version="4.3.0" level="required">
|
||||
<RESTRICT function="restrict_php50_version" message="php50restricted" />
|
||||
</PHP>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iconvrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
</PHP_EXTENSIONS>
|
||||
</MOODLE>
|
||||
<MOODLE version="1.8">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mysql" version="4.1.16">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mysql416required" />
|
||||
</FEEDBACK>
|
||||
<BYPASS function="bypass_mysql416_reqs" message="mysql416bypassed" />
|
||||
</VENDOR>
|
||||
<VENDOR name="postgres" version="7.4" />
|
||||
<VENDOR name="mssql" version="9.0" />
|
||||
<VENDOR name="odbc_mssql" version="9.0" />
|
||||
<VENDOR name="mssql_n" version="9.0" />
|
||||
<VENDOR name="oracle" version="9.0" />
|
||||
</DATABASE>
|
||||
<PHP version="4.3.0" level="required">
|
||||
|
||||
+2
-4
@@ -59,10 +59,10 @@
|
||||
// run through submitted data
|
||||
// reject if does not start with filter_
|
||||
foreach ($config as $name => $value) {
|
||||
set_config( $name,$value );
|
||||
set_config($name, stripslashes($value));
|
||||
}
|
||||
}
|
||||
redirect( "$CFG->wwwroot/$CFG->admin/filters.php", get_string('changessaved'), 1);
|
||||
redirect("$CFG->wwwroot/$CFG->admin/filters.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,5 @@
|
||||
<?php
|
||||
print_simple_box_end();
|
||||
|
||||
print_simple_box_end();
|
||||
|
||||
admin_externalpage_print_footer($adminroot);
|
||||
?>
|
||||
|
||||
+43
-15
@@ -27,6 +27,7 @@
|
||||
|
||||
$id = optional_param('id', '', PARAM_ALPHANUM);
|
||||
$confirmupgrade = optional_param('confirmupgrade', 0, PARAM_BOOL);
|
||||
$confirmrelease = optional_param('confirmrelease', 0, PARAM_BOOL);
|
||||
$agreelicence = optional_param('agreelicence',0, PARAM_BOOL);
|
||||
$ignoreupgradewarning = optional_param('ignoreupgradewarning', 0, PARAM_BOOL);
|
||||
|
||||
@@ -52,6 +53,13 @@
|
||||
error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
|
||||
}
|
||||
|
||||
if (empty($CFG->prefix) && $CFG->dbtype != 'mysql') { //Enforce prefixes for everybody but mysql
|
||||
error('$CFG->prefix can\'t be empty for your target DB (' . $CFG->dbtype . ')');
|
||||
}
|
||||
|
||||
if ($CFG->dbtype == 'oci8po' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc
|
||||
error('$CFG->prefix maximum allowed length for Oracle DBs is 2cc.');
|
||||
}
|
||||
|
||||
/// Check that config.php has been edited
|
||||
|
||||
@@ -133,6 +141,8 @@
|
||||
|
||||
/// Both old .sql files and new install.xml are supported
|
||||
/// But we prioritise install.xml (XMLDB) if present
|
||||
|
||||
change_db_encoding(); // first try to change db encoding to utf8
|
||||
$status = false;
|
||||
if (file_exists("$CFG->libdir/db/install.xml")) {
|
||||
$status = install_from_xmldb_file("$CFG->libdir/db/install.xml"); //New method
|
||||
@@ -214,19 +224,50 @@
|
||||
}
|
||||
|
||||
if (empty($confirmupgrade)) {
|
||||
|
||||
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
|
||||
"", "", false, " ", " ");
|
||||
|
||||
notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=yes', 'index.php');
|
||||
exit;
|
||||
|
||||
} else if (empty($confirmrelease)) {
|
||||
$strcurrentrelease = get_string("currentrelease");
|
||||
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, " ", " ");
|
||||
print_heading("Moodle $release");
|
||||
print_simple_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'center');
|
||||
|
||||
require_once($CFG->libdir.'/environmentlib.php');
|
||||
print_heading(get_string('environment', 'admin'));
|
||||
if (check_moodle_environment($release, $environment_results, true)) {
|
||||
notice_yesno(get_string('environmenterrorupgrade', 'admin'),
|
||||
'index.php?confirmupgrade=1&confirmrelease=1', 'index.php');
|
||||
} else {
|
||||
notify(get_string('environmentok', 'admin'), 'notifysuccess');
|
||||
|
||||
echo '<form action="index.php">';
|
||||
echo '<input type="hidden" name="confirmupgrade" value="1" />';
|
||||
echo '<input type="hidden" name="confirmrelease" value="1" />';
|
||||
echo '<div class="continuebutton"><input type="submit" value="'.get_string('continue').'" /></div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
print_footer('none');
|
||||
exit;
|
||||
|
||||
} else {
|
||||
$strdatabasesuccess = get_string("databasesuccess");
|
||||
print_header($strdatabasechecking, $stradministration, $strdatabasechecking,
|
||||
"", $linktoscrolltoerrors, false, " ", " ");
|
||||
|
||||
/// return to original debugging level
|
||||
$CFG->debug = $origdebug;
|
||||
error_reporting($CFG->debug);
|
||||
upgrade_log_start();
|
||||
|
||||
/// Upgrade current language pack if we can
|
||||
upgrade_language_pack();
|
||||
|
||||
print_heading($strdatabasechecking);
|
||||
$db->debug=true;
|
||||
/// Launch the old main upgrade (if exists)
|
||||
@@ -280,13 +321,9 @@
|
||||
/// Updated human-readable release version if necessary
|
||||
|
||||
if ($release <> $CFG->release) { // Update the release version
|
||||
$strcurrentrelease = get_string("currentrelease");
|
||||
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, " ", " ");
|
||||
print_heading("Moodle $release");
|
||||
if (!set_config("release", $release)) {
|
||||
notify("ERROR: Could not update release version in database!!");
|
||||
error("ERROR: Could not update release version in database!!");
|
||||
}
|
||||
notice(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'index.php', 'none');
|
||||
}
|
||||
|
||||
/// Find and check all main modules and load them up or upgrade them if necessary
|
||||
@@ -382,7 +419,7 @@
|
||||
|
||||
/// Define the unique site ID code if it isn't already
|
||||
if (empty($CFG->siteidentifier)) { // Unique site identification code
|
||||
set_config('siteidentifier', random_string(32));
|
||||
set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
|
||||
}
|
||||
|
||||
/// Check if the guest user exists. If not, create one.
|
||||
@@ -511,15 +548,6 @@
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (optional_param('dbmigrate')) { // ??? Is this actually used?
|
||||
print_simple_box_start('center','60%');
|
||||
require_once($CFG->dirroot.'/'.$CFG->admin.'/utfdbmigrate.php');
|
||||
db_migrate2utf8();
|
||||
print_simple_box_end();
|
||||
}
|
||||
|
||||
|
||||
admin_externalpage_print_footer($adminroot);
|
||||
|
||||
|
||||
|
||||
+15
-3
@@ -4,6 +4,9 @@
|
||||
*
|
||||
* CHANGES
|
||||
*
|
||||
* 2006/11/07 mudrd8mz
|
||||
* Fixed bug MDL-7361. Thanks to Dan Poltawski for the patch proposal.
|
||||
*
|
||||
* 2006/06/08 mudrd8mz
|
||||
* 1) Fixed bug 5745 reported by Harry Smith so now can edit en_utf8_local pack
|
||||
* 2) More notification messages included
|
||||
@@ -133,13 +136,14 @@
|
||||
|
||||
// Get a list of all the root files in the English directory
|
||||
|
||||
$langbase = $CFG->dataroot . '/lang';
|
||||
$enlangdir = "$CFG->dirroot/lang/en_utf8";
|
||||
if ($currentlang == 'en_utf8') {
|
||||
$langdir = $enlangdir;
|
||||
} else {
|
||||
$langdir = "$CFG->dataroot/lang/$currentlang";
|
||||
$langdir = "$langbase/$currentlang";
|
||||
}
|
||||
$locallangdir = "$CFG->dataroot/lang/{$currentlang}_local";
|
||||
$locallangdir = "$langbase/{$currentlang}_local";
|
||||
|
||||
if (! $stringfiles = get_directory_list($enlangdir, "", false)) {
|
||||
error("Could not find English language pack!");
|
||||
@@ -256,6 +260,14 @@
|
||||
|
||||
} else if ($mode == "compare") {
|
||||
|
||||
if (!file_exists($langbase) ){
|
||||
if (!lang_make_directory($langbase) ){
|
||||
error('ERROR: Could not create base lang directory ' . $langbase);
|
||||
} else {
|
||||
echo '<div class="notifysuccess" align="center">Created directory '.
|
||||
$langbase .'</div>'."<br />\n";
|
||||
}
|
||||
}
|
||||
if (!$uselocal && !file_exists($langdir)) {
|
||||
if (!lang_make_directory($langdir)) {
|
||||
error('ERROR: Could not create directory '.$langdir);
|
||||
@@ -573,7 +585,7 @@ function lang_fix_value_from_file($value='') {
|
||||
* Try and create a new language directory.
|
||||
*
|
||||
* @uses $CFG
|
||||
* @param string $directory directory name under $CFG->dataroot/lang eg cs_utf8_local
|
||||
* @param string $directory full path to the directory under $langbase
|
||||
* @return string|false Returns full path to directory if successful, false if not
|
||||
*/
|
||||
function lang_make_directory($dir, $shownotices=true) {
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@
|
||||
$settings = "";
|
||||
}
|
||||
|
||||
$count = count_records("$module->name");
|
||||
$count = count_records_select("$module->name",'course<>0');
|
||||
|
||||
if ($module->visible) {
|
||||
$visible = "<a href=\"modules.php?hide=$module->name&sesskey=$USER->sesskey\" title=\"$strhide\">".
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ function online_assignment_cleanup($output=false) {
|
||||
|
||||
|
||||
/// get a list of all courses on this site
|
||||
$courses = get_courses();
|
||||
$courses = get_records('course');
|
||||
|
||||
/// cycle through each course
|
||||
foreach ($courses as $course) {
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
}
|
||||
|
||||
if (empty($CFG->siteidentifier)) { // Unique site identification code
|
||||
set_config('siteidentifier', random_string(32));
|
||||
set_config('siteidentifier', random_string(32).$_SERVER['HTTP_HOST']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
|
||||
$tableprefix = $CFG->prefix.'stats_';
|
||||
|
||||
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend LIMIT 1');
|
||||
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend LIMIT 1');
|
||||
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend LIMIT 1');
|
||||
$earliestday = get_field_sql('SELECT timeend FROM '.$tableprefix.'daily ORDER BY timeend');
|
||||
$earliestweek = get_field_sql('SELECT timeend FROM '.$tableprefix.'weekly ORDER BY timeend');
|
||||
$earliestmonth = get_field_sql('SELECT timeend FROM '.$tableprefix.'monthly ORDER BY timeend');
|
||||
|
||||
if (empty($earliestday)) $earliestday = time();
|
||||
if (empty($earliestweek)) $earliestweek = time();
|
||||
@@ -66,24 +66,27 @@
|
||||
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
|
||||
|
||||
if (!empty($param->sql)) {
|
||||
$sql = $param->sql ." LIMIT ".$numcourses;
|
||||
$sql = $param->sql;
|
||||
} else {
|
||||
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
|
||||
." WHERE timeend >= ".$param->timeafter.' AND stattype = \'activity\''
|
||||
." GROUP BY courseid "
|
||||
.$param->extras
|
||||
." ORDER BY ".$param->orderby
|
||||
." LIMIT ".$numcourses;
|
||||
." ORDER BY ".$param->orderby;
|
||||
}
|
||||
error_log($sql);
|
||||
|
||||
$courses = get_records_sql($sql);
|
||||
$courses = get_records_sql($sql, 0, $numcourses);
|
||||
|
||||
if (empty($courses)) {
|
||||
notify(get_string('statsnodata'));
|
||||
|
||||
} else {
|
||||
echo '<div align="center"><img src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
|
||||
if (empty($CFG->gdversion)) {
|
||||
echo '<div align="center">(' . get_string("gdneed") .')</div>';
|
||||
} else {
|
||||
echo '<div align="center"><img src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></div>';
|
||||
}
|
||||
|
||||
$table = new StdClass;
|
||||
$table->align = array('left','center','center','center');
|
||||
|
||||
@@ -17,17 +17,16 @@
|
||||
$param = stats_get_parameters($time,$report,SITEID,STATS_MODE_RANKED);
|
||||
|
||||
if (!empty($param->sql)) {
|
||||
$sql = $param->sql ." LIMIT ".$numcourses;
|
||||
$sql = $param->sql;
|
||||
} else {
|
||||
$sql = "SELECT courseid,".$param->fields." FROM ".$CFG->prefix.'stats_'.$param->table
|
||||
." WHERE timeend >= ".$param->timeafter.' AND stattype = \'activity\''
|
||||
." GROUP BY courseid "
|
||||
.$param->extras
|
||||
." ORDER BY ".$param->orderby
|
||||
." LIMIT ".$numcourses;
|
||||
." ORDER BY ".$param->orderby;
|
||||
}
|
||||
|
||||
$courses = get_records_sql($sql);
|
||||
$courses = get_records_sql($sql, 0, $numcourses);
|
||||
|
||||
if (empty($courses)) {
|
||||
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php');
|
||||
@@ -40,6 +39,8 @@
|
||||
$graph->parameter['legend_size'] = 10;
|
||||
$graph->parameter['x_axis_angle'] = 90;
|
||||
$graph->parameter['title'] = false; // moodle will do a nicer job.
|
||||
$graph->y_tick_labels = null;
|
||||
$graph->offset_relation = null;
|
||||
if ($report != STATS_REPORT_ACTIVE_COURSES) {
|
||||
$graph->parameter['y_decimal_left'] = 2;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
// $strstats";
|
||||
|
||||
// print_header("$course->shortname: $strstats", "$course->fullname",
|
||||
// $crumb, '', '', true, ' ', $menu);
|
||||
// $crumb, '', '', true, ' ', $menu);
|
||||
|
||||
|
||||
require_once($CFG->dirroot.'/course/report/stats/report.php');
|
||||
|
||||
+22
-10
@@ -23,14 +23,30 @@
|
||||
document.assignform.remove.disabled=false;
|
||||
document.assignform.addselect.selectedIndex=-1;" />
|
||||
<?php
|
||||
foreach ($contextusers as $contextuser) {
|
||||
$fullname = fullname($contextuser, true);
|
||||
echo "<option value=\"$contextuser->id\">".$fullname.", ".$contextuser->email."</option>\n";
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($contextusers as $contextuser) {
|
||||
$fullname = fullname($contextuser, true);
|
||||
if ($contextuser->hidden) {
|
||||
$hidden=' ('.get_string('hiddenassign').') ';
|
||||
} else {
|
||||
$hidden="";
|
||||
}
|
||||
echo "<option value=\"$contextuser->id\">".$fullname.", ".$contextuser->email.$hidden."</option>\n";
|
||||
$i++;
|
||||
}
|
||||
if ($i==0) {
|
||||
echo '<option/>'; // empty select breaks xhtml strict
|
||||
}
|
||||
?>
|
||||
|
||||
</select></td>
|
||||
<td valign="top">
|
||||
<label title="<?php print_string('hiddenassign') ?>">
|
||||
<input type="checkbox" name="hidden" value="1" />
|
||||
<img src="<?php echo $CFG->pixpath; ?>/t/hide.gif" alt="<?php print_string('hiddenassign') ?>" class="hide-show-image" /> <?
|
||||
helpbutton ('hiddenassign', get_string('hiddenassign'));
|
||||
?>
|
||||
</label>
|
||||
<br />
|
||||
<input name="add" type="submit" id="add" value="←" />
|
||||
<br />
|
||||
@@ -46,13 +62,11 @@
|
||||
|
||||
if (!empty($searchtext)) {
|
||||
echo "<optgroup label=\"$strsearchresults (" . $availableusers->_numOfRows . ")\">\n";
|
||||
while (! $availableusers->EOF) {
|
||||
$user = $availableusers->FetchObj();
|
||||
while ($user = rs_fetch_next_record($availableusers)) {
|
||||
if (!isset($contextusers[$user->id])) {
|
||||
$fullname = fullname($user, true);
|
||||
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
|
||||
}
|
||||
$availableusers->MoveNext();
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
|
||||
@@ -61,13 +75,11 @@
|
||||
echo '<optgroup label="'.get_string('toomanytoshow').'"><option></option></optgroup>'."\n"
|
||||
.'<optgroup label="'.get_string('trysearching').'"><option></option></optgroup>'."\n";
|
||||
} else {
|
||||
while (! $availableusers->EOF) {
|
||||
$user = $availableusers->FetchObj();
|
||||
while ($user = rs_fetch_next_record($availableusers)) {
|
||||
if (!isset($contextusers[$user->id])) {
|
||||
$fullname = fullname($user, true);
|
||||
echo "<option value=\"$user->id\">".$fullname.", ".$user->email."</option>\n";
|
||||
}
|
||||
$availableusers->MoveNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+31
-7
@@ -116,7 +116,6 @@
|
||||
$adminroot = admin_get_root();
|
||||
admin_externalpage_setup('assignroles', $adminroot);
|
||||
admin_externalpage_print_header($adminroot);
|
||||
print_heading($straction);
|
||||
} else {
|
||||
$currenttab = '';
|
||||
$tabsmode = 'assign';
|
||||
@@ -158,8 +157,25 @@
|
||||
|
||||
} else if ($remove and !empty($frm->removeselect) and confirm_sesskey()) {
|
||||
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$topleveladmin = false;
|
||||
|
||||
// we only worry about this if the role has doanything capability at site level
|
||||
if ($context->id == $sitecontext->id && $adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext)) {
|
||||
foreach ($adminroles as $adminrole) {
|
||||
if ($adminrole->id == $roleid) {
|
||||
$topleveladmin = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($frm->removeselect as $removeuser) {
|
||||
$removeuser = clean_param($removeuser, PARAM_INT);
|
||||
|
||||
if ($topleveladmin && ($removeuser == $USER->id)) { // Prevent unassigning oneself from being admin
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! role_unassign($roleid, $removeuser, 0, $context->id)) {
|
||||
$errors[] = "Could not remove user with id $removeuser from this role!";
|
||||
} else if ($inmeta) {
|
||||
@@ -179,12 +195,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print_heading_with_help(get_string('assignroles', 'role'), 'assignroles');
|
||||
|
||||
if ($context->contextlevel==CONTEXT_SYSTEM) {
|
||||
print_simple_box(get_string('globalroleswarning', 'role'));
|
||||
}
|
||||
|
||||
if ($roleid) { /// prints a form to swap roles
|
||||
|
||||
/// Get all existing participants in this context.
|
||||
// Why is this not done with get_users???
|
||||
|
||||
if (!$contextusers = get_role_users($roleid, $context, false, 'u.id, u.firstname, u.lastname, u.email')) {
|
||||
if (!$contextusers = get_role_users($roleid, $context, false, 'u.id, u.firstname, u.lastname, u.email, r.hidden')) {
|
||||
$contextusers = array();
|
||||
}
|
||||
|
||||
@@ -243,14 +266,15 @@
|
||||
$table->tablealign = 'center';
|
||||
$table->cellpadding = 5;
|
||||
$table->cellspacing = 0;
|
||||
$table->width = '20%';
|
||||
$table->head = array(get_string('roles', 'role'), get_string('users'));
|
||||
$table->wrap = array('nowrap', 'nowrap');
|
||||
$table->align = array('right', 'center');
|
||||
$table->width = '60%';
|
||||
$table->head = array(get_string('roles', 'role'), get_string('description'), get_string('users'));
|
||||
$table->wrap = array('nowrap', '', 'nowrap');
|
||||
$table->align = array('right', 'left', 'center');
|
||||
|
||||
foreach ($assignableroles as $roleid => $rolename) {
|
||||
$countusers = count_role_users($roleid, $context);
|
||||
$table->data[] = array('<a href="'.$baseurl.'&roleid='.$roleid.'">'.$rolename.'</a>', $countusers);
|
||||
$description = format_string(get_field('role', 'description', 'id', $roleid));
|
||||
$table->data[] = array('<a href="'.$baseurl.'&roleid='.$roleid.'">'.$rolename.'</a>',$description, $countusers);
|
||||
}
|
||||
|
||||
print_table($table);
|
||||
|
||||
+37
-22
@@ -52,17 +52,24 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php print_heading(get_string('permissions','role')) ?>
|
||||
<?php
|
||||
print_heading_with_help(get_string('permissions','role'), 'permissions');
|
||||
|
||||
$strinherit = get_string('inherit','role');
|
||||
$strallow = get_string('allow','role');
|
||||
$strprevent = get_string('prevent','role');
|
||||
$strprohibit = get_string('prohibit','role');
|
||||
?>
|
||||
|
||||
<table class="rolecap" align="center">
|
||||
|
||||
<tr>
|
||||
<th class="name" align="left"><?php print_string('capability','role') ?></th>
|
||||
<th class="inherit"><?php print_string('inherit','role') ?></th>
|
||||
<th class="allow"><?php print_string('allow','role') ?></th>
|
||||
<th class="prevent"><?php print_string('prevent','role') ?></th>
|
||||
<th class="prohibit"><?php print_string('prohibit','role') ?></th>
|
||||
<th class="risk"><?php print_string('risks','role') ?></th>
|
||||
<th class="inherit"><?php p($strinherit); ?></th>
|
||||
<th class="allow"><?php p($strallow); ?></th>
|
||||
<th class="prevent"><?php p($strprevent); ?></th>
|
||||
<th class="prohibit"><?php p($strprohibit); ?></th>
|
||||
<th class="risk" colspan="5"><?php print_string('risks','role') ?></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
@@ -71,10 +78,13 @@
|
||||
$contextlevel = 0;
|
||||
$component = '';
|
||||
|
||||
$strrisks = s(get_string('risks', 'role'));
|
||||
$strcapabilities = s(get_string('capabilities', 'role'));
|
||||
|
||||
foreach ($capabilities as $capability) {
|
||||
// prints a breaker if component or name or context level
|
||||
if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
|
||||
echo ('<tr class="rolecapheading header"><td colspan="6" class="header"><strong>'.
|
||||
echo ('<tr class="rolecapheading header"><td colspan="10" class="header"><strong>'.
|
||||
get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
|
||||
}
|
||||
|
||||
@@ -91,42 +101,47 @@ foreach ($capabilities as $capability) {
|
||||
$localoverride->permission = $role->{$capability->name};
|
||||
}
|
||||
|
||||
$disabled = ($action != 'edit') ? ' disabled="disabled" ' : '';
|
||||
$disabled = ($action != 'edit' and $action != 'add') ? ' disabled="disabled" ' : '';
|
||||
|
||||
$riskinfo = '';
|
||||
$riskinfo = '<td class="risk managetrust">';
|
||||
$rowclasses = '';
|
||||
if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">T</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">T</a>';
|
||||
$rowclasses .= ' riskmanagetrust';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk config">';
|
||||
if (RISK_CONFIG & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">C</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">C</a>';
|
||||
$rowclasses .= ' riskconfig';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk xss">';
|
||||
if (RISK_XSS & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">X</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">X</a>';
|
||||
$rowclasses .= ' riskxss';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk personal">';
|
||||
if (RISK_PERSONAL & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">P</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">P</a>';
|
||||
$rowclasses .= ' riskpersonal';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk spam">';
|
||||
if (RISK_SPAM & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">S</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">S</a>';
|
||||
$rowclasses .= ' riskspam';
|
||||
}
|
||||
$riskinfo .= '</td>';
|
||||
|
||||
?>
|
||||
|
||||
<tr class="rolecap <?php echo $rowclasses; ?>">
|
||||
<td class="name"><span title="<?php echo $capability->name ?>"><?php echo get_capability_string($capability->name); ?></span></td>
|
||||
<td class="inherit"><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_INHERIT ?>" <?php if (!isset($localoverride->permission) || $localoverride->permission==CAP_INHERIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
<td class="allow"><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_ALLOW ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_ALLOW){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
<td class="prevent" ><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PREVENT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PREVENT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
<td class="prohibit" ><input type="radio" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PROHIBIT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PROHIBIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
<td class="risk"><?php
|
||||
echo $riskinfo;
|
||||
?></td>
|
||||
<td class="name"><span class="cap-desc"><a target="docspopup" href="<?php echo $CFG->docroot.'/'.$lang.'/'.$strcapabilities.'/'.$capability->name ?>"><?php echo get_capability_string($capability->name); ?></a><span class="cap-name"><?php echo $capability->name ?></span></label></td>
|
||||
<td class="inherit"><input type="radio" title="<?php p($strinherit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_INHERIT ?>" <?php if (!isset($localoverride->permission) || $localoverride->permission==CAP_INHERIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
<td class="allow"><input type="radio" title="<?php p($strallow); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_ALLOW ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_ALLOW){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
<td class="prevent" ><input type="radio" title="<?php p($strprevent); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PREVENT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PREVENT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
<td class="prohibit" ><input type="radio" title="<?php p($strprohibit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PROHIBIT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PROHIBIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||
|
||||
<?php echo $riskinfo; ?>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
$cancel = optional_param('cancel', 0, PARAM_BOOL);
|
||||
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
|
||||
require_capability('moodle/role:manage', $sitecontext);
|
||||
|
||||
if ($cancel) {
|
||||
redirect('manage.php');
|
||||
@@ -171,6 +172,7 @@
|
||||
// update normal role settings
|
||||
$role->id = $roleid;
|
||||
$role->name = $name;
|
||||
$role->shortname = $shortname;
|
||||
$role->description = $description;
|
||||
|
||||
if (!update_record('role', $role)) {
|
||||
@@ -223,9 +225,9 @@
|
||||
if (array_key_exists($roleid, $roles) and confirm_sesskey()) {
|
||||
$role = $roles[$roleid];
|
||||
if ($role->sortorder + 1 < $rolescount) {
|
||||
$bellow = $roles[$rolesort[$role->sortorder + 1]];
|
||||
$below = $roles[$rolesort[$role->sortorder + 1]];
|
||||
|
||||
if (!switch_roles($role, $bellow)) {
|
||||
if (!switch_roles($role, $below)) {
|
||||
error("Cannot move role with ID $roleid");
|
||||
}
|
||||
}
|
||||
@@ -280,13 +282,13 @@
|
||||
|
||||
switch ($action) {
|
||||
case 'add':
|
||||
print_heading(get_string('addrole', 'role'));
|
||||
print_heading_with_help(get_string('addrole', 'role'), 'roles');
|
||||
break;
|
||||
case 'view':
|
||||
print_heading(get_string('viewrole', 'role'));
|
||||
print_heading_with_help(get_string('viewrole', 'role'), 'roles');
|
||||
break;
|
||||
case 'edit':
|
||||
print_heading(get_string('editrole', 'role'));
|
||||
print_heading_with_help(get_string('editrole', 'role'), 'roles');
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -317,6 +319,8 @@
|
||||
|
||||
} else {
|
||||
|
||||
print_heading_with_help(get_string('roles', 'role'), 'roles');
|
||||
|
||||
$table = new object;
|
||||
|
||||
$table->tablealign = 'center';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
// this page deals with the 2 tabs for manage.php and grant.php
|
||||
|
||||
$toprow[] = new tabobject('manage', $CFG->wwwroot.'/'.$CFG->admin.'/roles/manage.php', get_string('manageroles', 'role'));
|
||||
$toprow[] = new tabobject('manage', $CFG->wwwroot.'/'.$CFG->admin.'/roles/manage.php', get_string('manageroles', 'role'),'', true);
|
||||
|
||||
$toprow[] = new tabobject('allowassign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/allowassign.php', get_string('allowassign', 'role'));
|
||||
|
||||
|
||||
+34
-19
@@ -1,3 +1,10 @@
|
||||
<?php
|
||||
$strinherit = get_string('inherit','role');
|
||||
$strallow = get_string('allow','role');
|
||||
$strprevent = get_string('prevent','role');
|
||||
$strprohibit = get_string('prohibit','role');
|
||||
?>
|
||||
|
||||
<form name="overrideform" action="override.php" method="post">
|
||||
<input type="hidden" name="contextid" value="<?php p($contextid) ?>">
|
||||
<input type="hidden" name="roleid" value="<?php p($roleid) ?>">
|
||||
@@ -8,11 +15,11 @@
|
||||
<table class="rolecap">
|
||||
<tr>
|
||||
<th class="name" align="left"><?php print_string('capability','role') ?></th>
|
||||
<th class="inherit"><?php print_string('inherit','role') ?></th>
|
||||
<th class="allow"><?php print_string('allow','role') ?></th>
|
||||
<th class="prevent"><?php print_string('prevent','role') ?></th>
|
||||
<th class="prohibit"><?php print_string('prohibit','role') ?></th>
|
||||
<th class="risk"><?php print_string('risks','role') ?></th>
|
||||
<th class="inherit"><?php p($strinherit); ?></th>
|
||||
<th class="allow"><?php p($strallow); ?></th>
|
||||
<th class="prevent"><?php p($strprevent); ?></th>
|
||||
<th class="prohibit"><?php p($strprohibit); ?></th>
|
||||
<th class="risk" colspan="5"><?php print_string('risks','role') ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@@ -20,10 +27,13 @@
|
||||
$contextlevel = 0;
|
||||
$component = '';
|
||||
|
||||
$strrisks = s(get_string('risks', 'role'));
|
||||
$strcapabilities = s(get_string('capabilities', 'role'));
|
||||
|
||||
foreach ($capabilities as $capability) {
|
||||
// prints a breaker if component or name or context level
|
||||
if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
|
||||
echo ('<tr class="rolecapheading header"><td colspan="6" class="header"><strong>'.get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
|
||||
echo ('<tr class="rolecapheading header"><td colspan="10" class="header"><strong>'.get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
|
||||
}
|
||||
|
||||
// these 2 are used to see to group same mod/core capabilities together
|
||||
@@ -49,63 +59,68 @@
|
||||
|
||||
$isdisabled = $isprohibit || islegacy($capability->name);
|
||||
|
||||
$riskinfo = '';
|
||||
$riskinfo = '<td class="risk managetrust">';
|
||||
$rowclasses = '';
|
||||
if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">T</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">T</a>';
|
||||
$rowclasses .= ' riskmanagetrust';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk config">';
|
||||
if (RISK_CONFIG & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">C</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">C</a>';
|
||||
$rowclasses .= ' riskconfig';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk xss">';
|
||||
if (RISK_XSS & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">X</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">X</a>';
|
||||
$rowclasses .= ' riskxss';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk personal">';
|
||||
if (RISK_PERSONAL & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">P</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">P</a>';
|
||||
$rowclasses .= ' riskpersonal';
|
||||
}
|
||||
$riskinfo .= '</td><td class="risk spam">';
|
||||
if (RISK_SPAM & (int)$capability->riskbitmask) {
|
||||
$riskinfo .= '<a title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">S</a>';
|
||||
$riskinfo .= '<a target="docspopup" title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">S</a>';
|
||||
$rowclasses .= ' riskspam';
|
||||
}
|
||||
$riskinfo .= '</td>';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr class="rolecap <?php echo $rowclasses; ?>">
|
||||
<td class="name"><?php echo get_capability_string($capability->name); ?></td>
|
||||
<td class="name"><span class="cap-desc"><a target="docspopup" href="<?php echo $CFG->docroot.'/'.$lang.'/'.$strcapabilities.'/'.$capability->name ?>"><?php echo get_capability_string($capability->name); ?></a><span class="cap-name"><?php echo $capability->name ?></span></label></td>
|
||||
|
||||
<td class="inherit">
|
||||
<input type="radio" name="<?php echo $capability->name; ?>" value="0"
|
||||
<input type="radio" title="<?php p($strinherit); ?>" name="<?php echo $capability->name; ?>" value="0"
|
||||
<?php
|
||||
if ($localpermission == CAP_INHERIT) {echo 'checked="checked"';}
|
||||
if ($isdisabled) {echo 'disabled="disabled"';}?> />
|
||||
</td>
|
||||
|
||||
<td class="inherit <?php if ($isallow) {echo ' capcurrent';} ?>">
|
||||
<input type="radio" name="<?php echo $capability->name; ?>"
|
||||
<td class="allow <?php if ($isallow) {echo ' capcurrent';} ?>">
|
||||
<input type="radio" title="<?php p($strallow); ?>" name="<?php echo $capability->name; ?>"
|
||||
<?php echo ' value="'.CAP_ALLOW.'"';
|
||||
if ($localpermission == CAP_ALLOW) {echo ' checked="checked"';}
|
||||
if ($isdisabled) {echo ' disabled="disabled"';}?> />
|
||||
</td>
|
||||
|
||||
<td class="prevent <?php if ($isprevent) {echo ' capcurrent';} ?>">
|
||||
<input type="radio" name="<?php echo $capability->name; ?>"
|
||||
<input type="radio" title="<?php p($strprevent); ?>" name="<?php echo $capability->name; ?>"
|
||||
<?php echo ' value="'.CAP_PREVENT.'"';
|
||||
if ($localpermission == CAP_PREVENT) {echo ' checked="checked"';}
|
||||
if ($isdisabled) {echo ' disabled="disabled"';}?> />
|
||||
</td>
|
||||
|
||||
<td class="prohibit <?php if ($isprohibit) {echo ' capcurrent';} ?>">
|
||||
<input type="radio" name="<?php echo $capability->name; ?>"
|
||||
<input type="radio" title="<?php p($strprohibit); ?>" name="<?php echo $capability->name; ?>"
|
||||
<?php echo ' value="'.CAP_PROHIBIT.'"';
|
||||
if ($localpermission == CAP_PROHIBIT) {echo ' checked="checked"';}
|
||||
if ($isdisabled) {echo ' disabled="disabled"';}?> />
|
||||
</td>
|
||||
<td class="risk"><?php echo $riskinfo; ?></td>
|
||||
<?php echo $riskinfo; ?>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
include_once('tabs.php');
|
||||
}
|
||||
|
||||
print_heading_with_help(get_string('overrides', 'role'), 'overrides');
|
||||
|
||||
$overridableroles = get_overridable_roles($context);
|
||||
|
||||
@@ -188,15 +189,16 @@
|
||||
$table->tablealign = 'center';
|
||||
$table->cellpadding = 5;
|
||||
$table->cellspacing = 0;
|
||||
$table->width = '20%';
|
||||
$table->head = array(get_string('roles', 'role'), get_string('overrides', 'role'));
|
||||
$table->wrap = array('nowrap', 'nowrap');
|
||||
$table->align = array('right', 'center');
|
||||
$table->width = '60%';
|
||||
$table->head = array(get_string('roles', 'role'), get_string('description'), get_string('overrides', 'role'));
|
||||
$table->wrap = array('nowrap', '', 'nowrap');
|
||||
$table->align = array('right', 'left', 'center');
|
||||
|
||||
foreach ($overridableroles as $roleid => $rolename) {
|
||||
$countusers = 0;
|
||||
$overridecount = count_records_select('role_capabilities', "roleid = $roleid AND contextid = $context->id");
|
||||
$table->data[] = array('<a href="'.$baseurl.'&roleid='.$roleid.'">'.$rolename.'</a>', $overridecount);
|
||||
$description = format_string(get_field('role', 'description', 'id', $roleid));
|
||||
$table->data[] = array('<a href="'.$baseurl.'&roleid='.$roleid.'">'.$rolename.'</a>', $description, $overridecount);
|
||||
}
|
||||
|
||||
print_table($table);
|
||||
|
||||
+23
-15
@@ -13,43 +13,50 @@ admin_externalpage_setup('search', $adminroot); // now hidden page
|
||||
$CFG->adminsearchquery = $query; // So we can reference it in search boxes later in this invocation
|
||||
|
||||
|
||||
$resultshtml = search_settings_html(admin_get_root(), $query);
|
||||
|
||||
// now we'll deal with the case that the admin has submitted the form with changed settings
|
||||
|
||||
$statusmsg = '';
|
||||
|
||||
if ($data = data_submitted()) {
|
||||
$data = (array)$data;
|
||||
$unslashed = (array)stripslashes_recursive($data);
|
||||
if (confirm_sesskey()) {
|
||||
$olddbsessions = !empty($CFG->dbsessions);
|
||||
$changedsettings = search_settings(admin_get_root(), $query);
|
||||
$errors = '';
|
||||
|
||||
foreach($changedsettings as $changedsetting) {
|
||||
if (isset($data['s_' . $changedsetting->name])) {
|
||||
$errors .= $changedsetting->write_setting($data['s_' . $changedsetting->name]);
|
||||
} else {
|
||||
$errors .= $changedsetting->write_setting($changedsetting->defaultsetting);
|
||||
if (!isset($unslashed['s_' . $changedsetting->name])) {
|
||||
$unslashed['s_' . $changedsetting->name] = ''; // needed for checkboxes
|
||||
}
|
||||
$errors .= $changedsetting->write_setting($unslashed['s_' . $changedsetting->name]);
|
||||
}
|
||||
|
||||
if ($olddbsessions != !empty($CFG->dbsessions)) {
|
||||
require_logout();
|
||||
}
|
||||
|
||||
if (empty($errors)) {
|
||||
// there must be either redirect without message or continue button or else upgrade would be sometimes broken
|
||||
redirect($CFG->wwwroot . '/' . $CFG->admin . '/search.php?query=' . $query);
|
||||
die;
|
||||
$statusmsg = get_string('changessaved');
|
||||
} else {
|
||||
error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
|
||||
die;
|
||||
$statusmsg = get_string('errorwithsettings', 'admin') . ' <br />' . $errors;
|
||||
}
|
||||
} else {
|
||||
error(get_string('confirmsesskeybad', 'error'));
|
||||
die;
|
||||
}
|
||||
|
||||
// now update $SITE - it might have been changed
|
||||
$SITE = get_record('course', 'id', $SITE->id);
|
||||
$COURSE = clone($SITE);
|
||||
}
|
||||
|
||||
// and finally, if we get here, then there are matching settings and we have to print a form
|
||||
// to modify them
|
||||
admin_externalpage_print_header($adminroot);
|
||||
|
||||
// print_simple_box(get_string('upgradesettingsintro','admin'),'','100%','',5,'generalbox','');
|
||||
if ($statusmsg != '') {
|
||||
notify ($statusmsg);
|
||||
}
|
||||
|
||||
$resultshtml = search_settings_html(admin_get_root(), $query);
|
||||
|
||||
echo '<form action="search.php" method="post" name="adminsettings" id="adminsettings">';
|
||||
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
|
||||
@@ -62,6 +69,7 @@ if ($resultshtml != '') {
|
||||
} else {
|
||||
echo get_string('noresults','admin');
|
||||
}
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
|
||||
admin_externalpage_print_footer($adminroot);
|
||||
|
||||
+20
-10
@@ -49,12 +49,17 @@ if (!($root->check_access())) {
|
||||
|
||||
$CFG->pagepath = 'admin/setting/'.$section;
|
||||
|
||||
// WRITING SUBMITTED DATA (IF ANY) -------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/// WRITING SUBMITTED DATA (IF ANY) -------------------------------------------------------------------------------
|
||||
|
||||
$statusmsg = '';
|
||||
|
||||
if ($data = data_submitted()) {
|
||||
if (confirm_sesskey()) {
|
||||
$olddbsessions = !empty($CFG->dbsessions);
|
||||
$errors = $root->write_settings((array)$data);
|
||||
$unslashed = (array)stripslashes_recursive($data);
|
||||
$errors = $root->write_settings($unslashed);
|
||||
//force logout if dbsession setting changes
|
||||
if ($olddbsessions != !empty($CFG->dbsessions)) {
|
||||
require_logout();
|
||||
@@ -66,22 +71,22 @@ if ($data = data_submitted()) {
|
||||
case 'admin':
|
||||
redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
default:
|
||||
// following redirect should display confirmation message because it redirects
|
||||
// to the same page, user might not know if save button worked
|
||||
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),2);
|
||||
$statusmsg = get_string('changessaved');
|
||||
}
|
||||
} else {
|
||||
error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
|
||||
$statusmsg = get_string('errorwithsettings', 'admin') . ' <br />' . $errors;
|
||||
}
|
||||
} else {
|
||||
error(get_string('confirmsesskeybad', 'error'));
|
||||
die;
|
||||
}
|
||||
// now update $SITE - it might have been changed
|
||||
$SITE = get_record('course', 'id', $SITE->id);
|
||||
$COURSE = clone($SITE);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/// print header stuff ------------------------------------------------------------
|
||||
// header must be printed after the redirects and require_logout
|
||||
if (!empty($SITE->fullname)) {
|
||||
$pageblocks = blocks_setup($PAGE);
|
||||
|
||||
@@ -90,7 +95,6 @@ if (!empty($SITE->fullname)) {
|
||||
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
|
||||
BLOCK_R_MAX_WIDTH);
|
||||
|
||||
// print header stuff
|
||||
$PAGE->print_header();
|
||||
|
||||
echo '<table id="layout-table"><tr>';
|
||||
@@ -105,6 +109,12 @@ if (!empty($SITE->fullname)) {
|
||||
|
||||
}
|
||||
|
||||
if ($statusmsg != '') {
|
||||
notify ($statusmsg);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
echo '<form action="settings.php" method="post" name="adminsettings" id="adminsettings">';
|
||||
echo '<input type="hidden" name="section" value="' . $PAGE->section . '" />';
|
||||
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
|
||||
|
||||
@@ -17,8 +17,8 @@ $ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themes
|
||||
|
||||
// "frontpage" settingpage
|
||||
$temp = new admin_settingpage('frontpage', get_string('frontpage','admin'));
|
||||
$temp->add(new admin_setting_sitesettext('fullname', get_string('fullsitename'), '', '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_sitesettext('shortname', get_string('shortsitename'), '', PARAM_NOTAGS));
|
||||
$temp->add(new admin_setting_sitesettext('fullname', get_string('fullsitename'), '', ''));
|
||||
$temp->add(new admin_setting_sitesettext('shortname', get_string('shortsitename'), '', ''));
|
||||
$temp->add(new admin_setting_special_frontpagedesc());
|
||||
$temp->add(new admin_setting_courselist_frontpage(false)); // non-loggedin version of the setting (that's what the parameter is for :) )
|
||||
$temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
|
||||
@@ -118,6 +118,16 @@ $temp = new admin_settingpage('mymoodle', get_string('mymoodle', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('mymoodleredirect', get_string('mymoodleredirect', 'admin'), get_string('configmymoodleredirect', 'admin'), 0));
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// new CFG variable for gradebook (what roles to display)
|
||||
$temp = new admin_settingpage('gradebook', get_string('gradebook', 'admin'));
|
||||
$temp->add(new admin_setting_special_gradebookroles());
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
// new CFG variable for coursemanager (what roles to display)
|
||||
$temp = new admin_settingpage('coursemanager', get_string('coursemanager', 'admin'));
|
||||
$temp->add(new admin_setting_special_coursemanager());
|
||||
$ADMIN->add('appearance', $temp);
|
||||
|
||||
$ADMIN->add('appearance', new admin_externalpage('stickyblocks', get_string('stickyblocks', 'admin'), "$CFG->wwwroot/$CFG->admin/stickyblocks.php"));
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
<?php // $Id$
|
||||
|
||||
// * Miscellaneous settings (still to be sorted)
|
||||
// * Miscellaneous settings
|
||||
|
||||
// Experimental settings page
|
||||
$temp = new admin_settingpage('experimental', get_string('experimental', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0));
|
||||
$ADMIN->add('misc', $temp);
|
||||
|
||||
// XMLDB editor
|
||||
$ADMIN->add('misc', new admin_externalpage('xmldbeditor', get_string('xmldbeditor'), "$CFG->wwwroot/$CFG->admin/xmldb/"));
|
||||
|
||||
|
||||
// hidden scripts linked from elsewhere
|
||||
$ADMIN->add('misc', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot.'/'.$CFG->admin.'/oacleanup.php', 'moodle/site:config', true));
|
||||
$ADMIN->add('misc', new admin_externalpage('upgradeforumread', 'Upgrade forum', $CFG->wwwroot.'/'.$CFG->admin.'/upgradeforumread.php', 'moodle/site:config', true));
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
$temp = new admin_settingpage('sitepolicies', get_string('sitepolicies', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('protectusernames', get_string('protectusernames', 'admin'), get_string('configprotectusernames', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('forcelogin', get_string('forcelogin', 'admin'), get_string('configforcelogin', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofiles', get_string('forceloginforprofiles', 'admin'), get_string('configforceloginforprofiles', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('forceloginforprofiles', get_string('forceloginforprofiles', 'admin'), get_string('configforceloginforprofiles', 'admin'), 1));
|
||||
$temp->add(new admin_setting_configcheckbox('opentogoogle', get_string('opentogoogle', 'admin'), get_string('configopentogoogle', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('maxbytes', get_string('maxbytes', 'admin'), get_string('configmaxbytes', 'admin'), 0, PARAM_INT));
|
||||
$temp->add(new admin_setting_configcheckbox('messaging', get_string('messaging', 'admin'), get_string('configmessaging','admin'), 1));
|
||||
@@ -87,8 +87,8 @@ $ADMIN->add('security', $temp);
|
||||
// "antivirus" settingpage
|
||||
$temp = new admin_settingpage('antivirus', get_string('antivirus', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('runclamonupload', get_string('runclamavonupload', 'admin'), get_string('configrunclamavonupload', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configtext('pathtoclam', get_string('pathtoclam', 'admin'), get_string('configpathtoclam', 'admin'), '', PARAM_PATH));
|
||||
$temp->add(new admin_setting_configtext('quarantinedir', get_string('quarantinedir', 'admin'), get_string('configquarantinedir', 'admin'), '', PARAM_PATH));
|
||||
$temp->add(new admin_setting_configtext('pathtoclam', get_string('pathtoclam', 'admin'), get_string('configpathtoclam', 'admin'), '', PARAM_RAW)); // TODO: add path validation
|
||||
$temp->add(new admin_setting_configtext('quarantinedir', get_string('quarantinedir', 'admin'), get_string('configquarantinedir', 'admin'), '', PARAM_RAW)); // TODO: add path validation
|
||||
$temp->add(new admin_setting_configselect('clamfailureonupload', get_string('clamfailureonupload', 'admin'), get_string('configclamfailureonupload', 'admin'), 'donothing', array('donothing' => get_string('configclamdonothing', 'admin'),
|
||||
'actlikevirus' => get_string('configclamactlikevirus', 'admin'))));
|
||||
$ADMIN->add('security', $temp);
|
||||
|
||||
@@ -7,10 +7,10 @@ $temp = new admin_settingpage('systempaths', get_string('systempaths','admin'));
|
||||
$temp->add(new admin_setting_configselect('gdversion', get_string('gdversion','admin'), get_string('configgdversion', 'admin'), check_gd_version(), array('0' => get_string('gdnot'),
|
||||
'1' => get_string('gd1'),
|
||||
'2' => get_string('gd2'))));
|
||||
$temp->add(new admin_setting_configtext('zip', get_string('pathtozip','admin'), get_string('configzip', 'admin'), '', PARAM_PATH));
|
||||
$temp->add(new admin_setting_configtext('unzip', get_string('pathtounzip','admin'), get_string('configunzip', 'admin'), '', PARAM_PATH));
|
||||
$temp->add(new admin_setting_configtext('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), '', PARAM_PATH));
|
||||
$temp->add(new admin_setting_configtext('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), '', PARAM_PATH));
|
||||
$temp->add(new admin_setting_configtext('zip', get_string('pathtozip','admin'), get_string('configzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
|
||||
$temp->add(new admin_setting_configtext('unzip', get_string('pathtounzip','admin'), get_string('configunzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
|
||||
$temp->add(new admin_setting_configtext('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), '', PARAM_RAW)); // TODO: add path validation
|
||||
$temp->add(new admin_setting_configtext('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), '', PARAM_RAW)); // TODO: add path validation
|
||||
$ADMIN->add('server', $temp, 0);
|
||||
|
||||
|
||||
@@ -175,6 +175,11 @@ $ADMIN->add('server', new admin_externalpage('environment', get_string('environm
|
||||
$ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
|
||||
|
||||
|
||||
// "performance" settingpage
|
||||
$temp = new admin_settingpage('performance', get_string('performance', 'admin'));
|
||||
$temp->add(new admin_setting_configcheckbox('enablerecordcache', get_string('enablerecordcache', 'admin'), get_string('configenablerecordcache', 'admin'), 1));
|
||||
$ADMIN->add('server', $temp);
|
||||
|
||||
if (file_exists("$CFG->dirroot/$CFG->admin/mysql/frame.php")) {
|
||||
$ADMIN->add('server', new admin_externalpage('database', get_string('managedatabase'), "$CFG->wwwroot/$CFG->admin/mysql/frame.php"));
|
||||
}
|
||||
|
||||
@@ -28,7 +28,12 @@ $ADMIN->add('root', new admin_category('appearance', get_string('appearance','ad
|
||||
$ADMIN->add('root', new admin_category('server', get_string('server','admin')));
|
||||
|
||||
$ADMIN->add('root', new admin_category('reports', get_string('reports')));
|
||||
foreach(get_list_of_plugins('admin/report') as $plugin) {
|
||||
foreach (get_list_of_plugins('admin/report') as $plugin) {
|
||||
/// This snippet is temporary until simpletest can be fixed to use xmldb. See MDL-7377 XXX TODO
|
||||
if ($plugin == 'simpletest' && $CFG->dbtype != 'mysql' && $CFG->dbtype != 'postgres7') {
|
||||
continue;
|
||||
}
|
||||
/// End of removable snippet
|
||||
$ADMIN->add('reports', new admin_externalpage('report'.$plugin, get_string($plugin, 'admin'), "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php"));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ $ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('upload
|
||||
// stuff under the "roles" subcategory
|
||||
$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
|
||||
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php"));
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . SITEID));
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $sitecontext->id));
|
||||
|
||||
|
||||
// "userpolicies" settingpage
|
||||
|
||||
@@ -24,14 +24,14 @@ if ($newsettingshtml == '') {
|
||||
|
||||
// now we'll deal with the case that the admin has submitted the form with new settings
|
||||
if ($data = data_submitted()) {
|
||||
$data = (array)$data;
|
||||
$unslashed = (array)stripslashes_recursive($data);
|
||||
if (confirm_sesskey()) {
|
||||
$newsettings = find_new_settings(admin_get_root());
|
||||
$errors = '';
|
||||
|
||||
foreach($newsettings as $newsetting) {
|
||||
if (isset($data['s_' . $newsetting->name])) {
|
||||
$errors .= $newsetting->write_setting($data['s_' . $newsetting->name]);
|
||||
if (isset($unslashed['s_' . $newsetting->name])) {
|
||||
$errors .= $newsetting->write_setting($unslashed['s_' . $newsetting->name]);
|
||||
} else {
|
||||
$errors .= $newsetting->write_setting($newsetting->defaultsetting);
|
||||
}
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@
|
||||
redirect('index.php');
|
||||
}
|
||||
|
||||
if (!$CFG->rolesactive) { // No admin user yet.
|
||||
if (empty($CFG->rolesactive)) { // No admin user yet.
|
||||
|
||||
$user = new object();
|
||||
$user->firstname = get_string('admin');
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
sesskey(); // For added security, used to check script parameters
|
||||
|
||||
load_user_capability();
|
||||
load_all_capabilities();
|
||||
|
||||
redirect("$CFG->wwwroot/user/edit.php?id=$user->id&course=$site->id"); // Edit thyself
|
||||
exit;
|
||||
@@ -169,7 +169,7 @@
|
||||
$updateuser = new object();
|
||||
$updateuser->id = $user->id;
|
||||
$updateuser->deleted = 1;
|
||||
$updateuser->username = "$user->email.".time(); // Remember it just in case
|
||||
$updateuser->username = addslashes("$user->email.".time()); // Remember it just in case
|
||||
$updateuser->email = ''; // Clear this field to free it up
|
||||
$updateuser->idnumber = ''; // Clear this field to free it up
|
||||
$updateuser->timemodified = time();
|
||||
|
||||
@@ -594,8 +594,8 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
|
||||
* converting each record *
|
||||
**************************/
|
||||
while(($counter < $totalrecords) and ($fieldname !='dummy') and ($method!='NO_CONV')) { //while there is still something
|
||||
$SQL = 'SELECT * FROM '.$prefix.$dbtablename.' ORDER BY id ASC '.sql_paging_limit($counter, $recordsetsize);
|
||||
if ($records = get_records_sql($SQL)) {
|
||||
$SQL = 'SELECT * FROM '.$prefix.$dbtablename.' ORDER BY id ASC';
|
||||
if ($records = get_records_sql($SQL, $counter, $recordsetsize)) {
|
||||
foreach ($records as $record) {
|
||||
|
||||
//if we are up this far, either no crash, or crash with same table, field name.
|
||||
|
||||
@@ -93,7 +93,7 @@ class test extends XMLDBAction {
|
||||
$table->addFieldInfo('type', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, XMLDB_ENUM, array('single', 'news', 'general', 'social', 'eachuser', 'teacher', 'qanda'), 'general');
|
||||
$table->addFieldInfo('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, '');
|
||||
$table->addFieldInfo('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, '');
|
||||
$table->addFieldInfo('logo', XMLDB_TYPE_BINARY, 'big', null, XMLDB_NOTNULL, null, null, null, '');
|
||||
$table->addFieldInfo('logo', XMLDB_TYPE_BINARY, 'big', null, XMLDB_NOTNULL, null, null, null);
|
||||
$table->addFieldInfo('assessed', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
|
||||
$table->addFieldInfo('assesstimestart', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
|
||||
$table->addFieldInfo('assesstimefinish', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
|
||||
@@ -114,6 +114,8 @@ class test extends XMLDBAction {
|
||||
$table->addIndexInfo('course', XMLDB_INDEX_NOTUNIQUE, array('course'));
|
||||
$table->addIndexInfo('rsstype', XMLDB_INDEX_UNIQUE, array('rsstype'));
|
||||
|
||||
$table->setComment("This is a test'n drop table. You can drop it safely");
|
||||
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
$test->sql = $table->getCreateTableSQL($CFG->dbtype, $CFG->prefix, true);
|
||||
@@ -142,8 +144,9 @@ class test extends XMLDBAction {
|
||||
$table->addFieldInfo('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
|
||||
$table->addFieldInfo('name', XMLDB_TYPE_CHAR, '30', null, null, null, null, null, 'Moodle');
|
||||
$table->addFieldInfo('secondname', XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null, null, null);
|
||||
$table->addFieldInfo('intro', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, null);
|
||||
$table->addFieldInfo('grade', XMLDB_TYPE_NUMBER, '20,10', null, null, null, null, null, '');
|
||||
$table->addFieldInfo('intro', XMLDB_TYPE_TEXT, 'medium', null, XMLDB_NOTNULL, null, null, null, null);
|
||||
$table->addFieldInfo('avatar', XMLDB_TYPE_BINARY, 'medium', null, null, null, null, null, null);
|
||||
$table->addFieldInfo('grade', XMLDB_TYPE_NUMBER, '20,10', null, null, null, null, null);
|
||||
$table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -181,7 +184,7 @@ class test extends XMLDBAction {
|
||||
if (!$test->status) {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['add field'] = $test;
|
||||
$tests['add enum field'] = $test;
|
||||
}
|
||||
|
||||
/// 5th test. Dropping one complex enum field
|
||||
@@ -193,7 +196,7 @@ class test extends XMLDBAction {
|
||||
if (!$test->status) {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['drop field'] = $test;
|
||||
$tests['drop enum field'] = $test;
|
||||
}
|
||||
|
||||
/// 6th test. Adding one complex enum field
|
||||
@@ -208,22 +211,38 @@ class test extends XMLDBAction {
|
||||
if (!$test->status) {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['add field again'] = $test;
|
||||
$tests['add enum field again'] = $test;
|
||||
}
|
||||
|
||||
/// 7th test. Dropping one complex enum field
|
||||
/// 7th test. Adding one numeric field
|
||||
if ($test->status) {
|
||||
/// Create a new field (numeric)
|
||||
$field = new XMLDBField('onenumber');
|
||||
$field->setAttributes(XMLDB_TYPE_INTEGER, '6', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, 0, 'type');
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
$test->sql = $table->getAddFieldSQL($CFG->dbtype, $CFG->prefix, $field, true);
|
||||
$test->status = add_field($table, $field, false, false);
|
||||
if (!$test->status) {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['add numeric field'] = $test;
|
||||
}
|
||||
|
||||
/// 8th test. Dropping one complex enum field
|
||||
if ($test->status) {
|
||||
/// Create a new field with complex specs (enums are good candidates)
|
||||
$field = new XMLDBField('type');
|
||||
$test = new stdClass;
|
||||
$test->sql = $table->getDropFieldSQL($CFG->dbtype, $CFG->prefix, $field, true);
|
||||
$test->status = drop_field($table, $field, false, false);
|
||||
if (!$test->status) {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['drop field again'] = $test;
|
||||
$tests['drop enum field again'] = $test;
|
||||
}
|
||||
|
||||
/// 8th test. Change the type of one column from integer to varchar
|
||||
/// 9th test. Change the type of one column from integer to varchar
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -238,7 +257,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field type (int2char)'] = $test;
|
||||
}
|
||||
|
||||
/// 9th test. Change the type of one column from varchar to integer
|
||||
/// 10th test. Change the type of one column from varchar to integer
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -253,12 +272,12 @@ class test extends XMLDBAction {
|
||||
$tests['change field type (char2int)'] = $test;
|
||||
}
|
||||
|
||||
/// 10th test. Change the type of one column from number to varchar
|
||||
/// 11th test. Change the type of one column from number to varchar
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
$field = new XMLDBField('grade');
|
||||
$field->setAttributes(XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, null, 'test');
|
||||
$field->setAttributes(XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, null, "test'n drop");
|
||||
|
||||
$test->sql = $table->getAlterFieldSQL($CFG->dbtype, $CFG->prefix, $field, true);
|
||||
$test->status = change_field_type($table, $field, false, false);
|
||||
@@ -268,7 +287,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field type (number2char)'] = $test;
|
||||
}
|
||||
|
||||
/// 11th test. Change the type of one column from varchar to float
|
||||
/// 12th test. Change the type of one column from varchar to float
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -283,7 +302,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field type (char2float)'] = $test;
|
||||
}
|
||||
|
||||
/// 12th test. Change the type of one column from float to char
|
||||
/// 13th test. Change the type of one column from float to char
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -298,7 +317,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field type (float2char)'] = $test;
|
||||
}
|
||||
|
||||
/// 13th test. Change the type of one column from char to number
|
||||
/// 14th test. Change the type of one column from char to number
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -314,7 +333,7 @@ class test extends XMLDBAction {
|
||||
}
|
||||
|
||||
|
||||
/// 14th test. Change the precision of one text field
|
||||
/// 15th test. Change the precision of one text field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -329,7 +348,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field precision (text)'] = $test;
|
||||
}
|
||||
|
||||
/// 15th test. Change the precision of one char field
|
||||
/// 16th test. Change the precision of one char field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -344,7 +363,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field precision (char)'] = $test;
|
||||
}
|
||||
|
||||
/// 16th test. Change the precision of one numeric field
|
||||
/// 17th test. Change the precision of one numeric field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -359,7 +378,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field precision (number)'] = $test;
|
||||
}
|
||||
|
||||
/// 17th test. Change the sign of one numeric field to unsigned
|
||||
/// 18th test. Change the sign of one numeric field to unsigned
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -374,7 +393,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field sign (unsigned)'] = $test;
|
||||
}
|
||||
|
||||
/// 18th test. Change the sign of one numeric field to signed
|
||||
/// 19th test. Change the sign of one numeric field to signed
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -389,7 +408,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field sign (signed)'] = $test;
|
||||
}
|
||||
|
||||
/// 19th test. Change the nullability of one char field to not null
|
||||
/// 20th test. Change the nullability of one char field to not null
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -404,7 +423,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field nullability (not null)'] = $test;
|
||||
}
|
||||
|
||||
/// 20th test. Change the nullability of one char field to null
|
||||
/// 21th test. Change the nullability of one char field to null
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -419,7 +438,7 @@ class test extends XMLDBAction {
|
||||
$tests['change field nullability (null)'] = $test;
|
||||
}
|
||||
|
||||
/// 21th test. Dropping the default of one field
|
||||
/// 22th test. Dropping the default of one field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -434,7 +453,7 @@ class test extends XMLDBAction {
|
||||
$tests['drop field default of NULL field'] = $test;
|
||||
}
|
||||
|
||||
/// 22th test. Creating the default for one field
|
||||
/// 23th test. Creating the default for one field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -449,7 +468,7 @@ class test extends XMLDBAction {
|
||||
$tests['add field default of NULL field'] = $test;
|
||||
}
|
||||
|
||||
/// 23th test. Creating the default for one field
|
||||
/// 24th test. Creating the default for one field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -465,7 +484,7 @@ class test extends XMLDBAction {
|
||||
}
|
||||
|
||||
|
||||
/// 24th test. Dropping the default of one NOT NULL field
|
||||
/// 25th test. Dropping the default of one NOT NULL field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -480,7 +499,7 @@ class test extends XMLDBAction {
|
||||
$tests['drop field default of NOT NULL field'] = $test;
|
||||
}
|
||||
|
||||
/// 25th test. Adding one unique index to the table
|
||||
/// 26th test. Adding one unique index to the table
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -495,7 +514,7 @@ class test extends XMLDBAction {
|
||||
$tests['add unique index'] = $test;
|
||||
}
|
||||
|
||||
/// 26th test. Adding one not unique index to the table
|
||||
/// 27th test. Adding one not unique index to the table
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -510,7 +529,7 @@ class test extends XMLDBAction {
|
||||
$tests['add not unique index'] = $test;
|
||||
}
|
||||
|
||||
/// 27th test. Re-add the same index than previous test. Check find_index_name() works.
|
||||
/// 28th test. Re-add the same index than previous test. Check find_index_name() works.
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -529,7 +548,7 @@ class test extends XMLDBAction {
|
||||
$tests['check find_index_name()'] = $test;
|
||||
}
|
||||
|
||||
/// 28th test. Dropping one index from the table
|
||||
/// 29th test. Dropping one index from the table
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -544,7 +563,7 @@ class test extends XMLDBAction {
|
||||
$tests['drop index'] = $test;
|
||||
}
|
||||
|
||||
/// 29th test. Adding one unique key to the table
|
||||
/// 30th test. Adding one unique key to the table
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -559,7 +578,7 @@ class test extends XMLDBAction {
|
||||
$tests['add unique key'] = $test;
|
||||
}
|
||||
|
||||
/// 30th test. Adding one foreign+unique key to the table
|
||||
/// 31th test. Adding one foreign+unique key to the table
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -574,7 +593,7 @@ class test extends XMLDBAction {
|
||||
$tests['add foreign+unique key'] = $test;
|
||||
}
|
||||
|
||||
/// 31th test. Drop one key
|
||||
/// 32th test. Drop one key
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -589,7 +608,7 @@ class test extends XMLDBAction {
|
||||
$tests['drop foreign+unique key'] = $test;
|
||||
}
|
||||
|
||||
/// 32th test. Adding one foreign key to the table
|
||||
/// 33th test. Adding one foreign key to the table
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -604,7 +623,7 @@ class test extends XMLDBAction {
|
||||
$tests['add foreign key'] = $test;
|
||||
}
|
||||
|
||||
/// 33th test. Drop one foreign key
|
||||
/// 34th test. Drop one foreign key
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -619,7 +638,7 @@ class test extends XMLDBAction {
|
||||
$tests['drop foreign key'] = $test;
|
||||
}
|
||||
|
||||
/// 34th test. Adding one complex enum field
|
||||
/// 35th test. Adding one complex enum field
|
||||
if ($test->status) {
|
||||
/// Create a new field with complex specs (enums are good candidates)
|
||||
$field = new XMLDBField('type');
|
||||
@@ -634,7 +653,7 @@ class test extends XMLDBAction {
|
||||
$tests['add field with enum'] = $test;
|
||||
}
|
||||
|
||||
/// 35th test. Dropping the enum of one field
|
||||
/// 36th test. Dropping the enum of one field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -649,7 +668,7 @@ class test extends XMLDBAction {
|
||||
$tests['delete enumlist from one field'] = $test;
|
||||
}
|
||||
|
||||
/// 36th test. Creating the enum for one field
|
||||
/// 37th test. Creating the enum for one field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -663,7 +682,7 @@ class test extends XMLDBAction {
|
||||
$tests['add enumlist to one field'] = $test;
|
||||
}
|
||||
|
||||
/// 37th test. Renaming one index
|
||||
/// 38th test. Renaming one index
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -678,7 +697,7 @@ class test extends XMLDBAction {
|
||||
$tests['rename index (experimental. DO NOT USE IT)'] = $test;
|
||||
}
|
||||
|
||||
/// 38th test. Renaming one key
|
||||
/// 39th test. Renaming one key
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -693,7 +712,7 @@ class test extends XMLDBAction {
|
||||
$tests['rename key (experimental. DO NOT USE IT)'] = $test;
|
||||
}
|
||||
|
||||
/// 39th test. Renaming one field
|
||||
/// 40th test. Renaming one field
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -708,7 +727,7 @@ class test extends XMLDBAction {
|
||||
$tests['rename field'] = $test;
|
||||
}
|
||||
|
||||
/// 40th test. Renaming one table
|
||||
/// 41th test. Renaming one table
|
||||
if ($test->status) {
|
||||
/// Get SQL code and execute it
|
||||
$test = new stdClass;
|
||||
@@ -721,7 +740,188 @@ class test extends XMLDBAction {
|
||||
$tests['rename table'] = $test;
|
||||
}
|
||||
|
||||
/// 42th test. Getting the PK sequence name for one table
|
||||
if ($test->status) {
|
||||
$test = new stdClass;
|
||||
$table->setName('newnameforthetable');
|
||||
$test->sql = array(find_sequence_name($table));
|
||||
$test->status = find_sequence_name($table);
|
||||
if (!$test->status) {
|
||||
if (!$test->error = $db->ErrorMsg()) { //If no db errors, result is ok. Just the driver doesn't support this
|
||||
$test->sql = array('not needed for this DB');
|
||||
$test->status = true;
|
||||
}
|
||||
}
|
||||
$tests['find sequence name'] = $test;
|
||||
}
|
||||
|
||||
/// 43th test. Inserting TEXT contents
|
||||
$textlib = textlib_get_instance();
|
||||
if ($test->status) {
|
||||
$test = new stdClass;
|
||||
$test->status = false;
|
||||
$test->sql = array();
|
||||
$basetext = '日本語 • Русский • Deutsch • English • Español • Français • Italiano • Nederlands • Polski • Português • Svenska • العربية • فارسی 한국어 • עברית • ไทย中文 Ελληνικά • Български • Српски • Українська • Bosanski • Català • Česky • Dansk • Eesti • Simple English • Esperanto • Euskara • Galego • Hrvatski • Ido • Bahasa Indonesia • Íslenska • Lëtzebuergesch • Lietuvių • Magyar • Bahasa Melayu اردو • ئۇيغۇرچه • हिन्दी • नेपाल भाषा मराठी • தமிழ் Հայերեն • Беларуская • Чăваш • Ирон æвзаг • Македонски • Сибирской говор • Afrikaans • Aragonés • Arpitan • Asturianu • Kreyòl Ayisyen • Azərbaycan • Bân-lâm-gú • Basa Banyumasan • Brezhoneg • Corsu • Cymraeg • Deitsch • Føroyskt • Frysk • Furlan • Gaeilge • Gàidhlig • Ilokano • Interlingua • Basa Jawa • Kapampangan • Kernewek • Kurdî كوردی • Ladino לאדינו • Latina • Latviešu • Limburgs • Lumbaart • Nedersaksisch • Nouormand • Occitan • O‘zbek • Piemontèis • Plattdüütsch • Ripoarisch • Sámegiella • Scots • Shqip • Sicilianu • Sinugboanon • Srpskohrvatski / Српскохрватски • Basa Sunda • Kiswahili • Tagalog • Tatarça • Walon • Winaray Авар • Башҡорт • Кыргызча Монгол • Қазақша • Тоҷикӣ • Удмурт • Armãneashce • Bamanankan • Eald Englisc • Gaelg • Interlingue • Kaszëbsczi • Kongo • Ligure • Lingála • lojban • Malagasy • Malti • Māori • Nāhuatl • Ekakairũ Naoero • Novial • Pangasinán • Tok Pisin • Romani / रोमानी • Rumantsch • Runa Simi • Sardu • Tetun • Türkmen / تركمن / Туркмен • Vèneto • Volapük • Võro • West-Vlaoms • Wollof • Zazaki • Žemaitėška';
|
||||
/// Create one big text (1.500.000 chars)
|
||||
$fulltext = '';
|
||||
for ($i=0; $i<1000; $i++) { //1500 * 1000 chars
|
||||
$fulltext .= $basetext;
|
||||
}
|
||||
|
||||
/// Build the record to insert
|
||||
$rec->intro = addslashes($fulltext);
|
||||
$rec->name = 'texttest';
|
||||
/// Calculate its length
|
||||
$textlen = $textlib->strlen($fulltext, current_charset());
|
||||
if ($rec->id = insert_record('newnameforthetable', $rec)) {
|
||||
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
|
||||
delete_records('newnameforthetable', 'id', $new->id);
|
||||
$newtextlen = $textlib->strlen($new->intro, current_charset());
|
||||
if ($fulltext === $new->intro) {
|
||||
$test->sql = array($newtextlen . ' cc. (text) sent and received ok');
|
||||
$test->status = true;
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
$test->sql = array($newtextlen . ' cc. (text) transfer failed. Data changed!');
|
||||
$test->status = false;
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['insert record '. $textlen . ' cc. (text)'] = $test;
|
||||
}
|
||||
|
||||
/// 44th test. Inserting BINARY contents
|
||||
if ($test->status) {
|
||||
$test = new stdClass;
|
||||
$test->status = false;
|
||||
/// Build the record to insert
|
||||
$rec->avatar = addslashes($fulltext);
|
||||
$rec->name = 'binarytest';
|
||||
/// Calculate its length
|
||||
$textlen = strlen($fulltext);
|
||||
if ($rec->id = insert_record('newnameforthetable', $rec)) {
|
||||
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
|
||||
$newtextlen = strlen($new->avatar);
|
||||
if ($fulltext === $new->avatar) {
|
||||
$test->sql = array($newtextlen . ' bytes (binary) sent and received ok');
|
||||
$test->status = true;
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
$test->sql = array($newtextlen . ' bytes (binary) transfer failed. Data changed!');
|
||||
$test->status = false;
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['insert record '. $textlen . ' bytes (binary)'] = $test;
|
||||
}
|
||||
|
||||
/// 45th test. update_record with TEXT and BINARY contents
|
||||
if ($test->status) {
|
||||
$test = new stdClass;
|
||||
$test->status = false;
|
||||
$test->sql = array();
|
||||
/// Build the record to insert
|
||||
$rec->intro = addslashes($basetext);
|
||||
$rec->avatar = addslashes($basetext);
|
||||
$rec->name = 'updatelobs';
|
||||
/// Calculate its length
|
||||
$textlen = $textlib->strlen($basetext, current_charset());
|
||||
$imglen = strlen($basetext);
|
||||
if (update_record('newnameforthetable', $rec)) {
|
||||
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
|
||||
$newtextlen = $textlib->strlen($new->intro, current_charset());
|
||||
$newimglen = strlen($new->avatar);
|
||||
if ($basetext === $new->avatar && $basetext === $new->intro) {
|
||||
$test->sql = array($newtextlen . ' cc. (text) sent and received ok',
|
||||
$newimglen . ' bytes (binary) sent and received ok');
|
||||
$test->status = true;
|
||||
} else {
|
||||
if ($rec->avatar !== $new->avatar) {
|
||||
$test->error = $db->ErrorMsg();
|
||||
$test->sql = array($newimglen . ' bytes (binary) transfer failed. Data changed!');
|
||||
$test->status = false;
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
$test->sql = array($newtextlen . ' cc. (text) transfer failed. Data changed!');
|
||||
$test->status = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['update record '. $textlen . ' cc. (text) and ' . $imglen . ' bytes (binary)'] = $test;
|
||||
}
|
||||
|
||||
/// 46th test. set_field with TEXT contents
|
||||
if ($test->status) {
|
||||
$test = new stdClass;
|
||||
$test->status = false;
|
||||
$test->sql = array();
|
||||
/// Build the record to insert
|
||||
$rec->intro = addslashes($fulltext);
|
||||
$rec->name = 'updatelobs';
|
||||
/// Calculate its length
|
||||
$textlen = $textlib->strlen($fulltext, current_charset());
|
||||
if (set_field('newnameforthetable', 'intro', $rec->intro, 'name', $rec->name)) {
|
||||
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
|
||||
$newtextlen = $textlib->strlen($new->intro);
|
||||
if ($fulltext === $new->intro) {
|
||||
$test->sql = array($newtextlen . ' cc. (text) sent and received ok');
|
||||
$test->status = true;
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
$test->sql = array($newtextlen . ' cc. (text) transfer failed. Data changed!');
|
||||
$test->status = false;
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['set field '. $textlen . ' cc. (text)'] = $test;
|
||||
}
|
||||
|
||||
/// 47th test. set_field with BINARY contents
|
||||
if ($test->status) {
|
||||
$test = new stdClass;
|
||||
$test->status = false;
|
||||
$test->sql = array();
|
||||
/// Build the record to insert
|
||||
$rec->avatar = addslashes($fulltext);
|
||||
$rec->name = 'updatelobs';
|
||||
/// Calculate its length
|
||||
$textlen = strlen($fulltext);
|
||||
if (set_field('newnameforthetable', 'avatar', $rec->avatar, 'name', $rec->name)) {
|
||||
if ($new = get_record('newnameforthetable', 'id', $rec->id)) {
|
||||
$newtextlen = strlen($new->avatar);
|
||||
if ($fulltext === $new->avatar) {
|
||||
$test->sql = array($newtextlen . ' bytes (binary) sent and received ok');
|
||||
$test->status = true;
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
$test->sql = array($newtextlen . ' bytes (binary) transfer failed. Data changed!');
|
||||
$test->status = false;
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
} else {
|
||||
$test->error = $db->ErrorMsg();
|
||||
}
|
||||
$tests['set field '. $textlen . ' bytes (binary)'] = $test;
|
||||
}
|
||||
|
||||
/// TODO: Check here values of the inserted records to see that everything ha the correct value
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class view_reserved_words extends XMLDBAction {
|
||||
|
||||
/// The textarea showing all the reserved words
|
||||
$o.= ' <table id="formelements" align="center" cellpadding="5">';
|
||||
$o.= ' <tr><td align="center">' . $this->str['listreservedwords'];
|
||||
$o.= ' <tr><td align="center">' . $this->str['listreservedwords'].'</td></tr>';
|
||||
$o.= ' <tr><td><textarea cols="80" rows="32">';
|
||||
$o.= s(implode(', ', $reserved_words));
|
||||
$o.= '</textarea></td></tr>';
|
||||
|
||||
@@ -99,7 +99,7 @@ class view_structure_php extends XMLDBAction {
|
||||
/// Calculate the popup of commands
|
||||
$commands = array('create_table',
|
||||
'drop_table',
|
||||
'rename_table (not imp!)');
|
||||
'rename_table');
|
||||
foreach ($commands as $command) {
|
||||
$popcommands[$command] = str_replace('_', ' ', $command);
|
||||
}
|
||||
@@ -211,7 +211,7 @@ class view_structure_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch create table for ' . $table->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && create_table($table);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && create_table($table);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -249,7 +249,7 @@ class view_structure_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch drop table for ' . $table->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && drop_table($table);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && drop_table($table);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -287,7 +287,7 @@ class view_structure_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch rename table for ' . $table->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && rename_table($table, ' . "'NEWNAMEGOESHERE'" . ');' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && rename_table($table, ' . "'NEWNAMEGOESHERE'" . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
|
||||
@@ -119,13 +119,12 @@ class view_table_php extends XMLDBAction {
|
||||
$commands = array('Fields',
|
||||
$optionspacer . 'add_field',
|
||||
$optionspacer . 'drop_field',
|
||||
$optionspacer . 'rename_field (not imp!)',
|
||||
$optionspacer . 'rename_field',
|
||||
$optionspacer . 'change_field_type',
|
||||
$optionspacer . 'change_field_precision',
|
||||
$optionspacer . 'change_field_unsigned',
|
||||
$optionspacer . 'change_field_notnull',
|
||||
$optionspacer . 'change_field_sequence (not imp!)',
|
||||
$optionspacer . 'change_field_enum (not imp!)',
|
||||
$optionspacer . 'change_field_enum',
|
||||
$optionspacer . 'change_field_default',
|
||||
'Keys',
|
||||
$optionspacer . 'add_key',
|
||||
@@ -229,6 +228,13 @@ class view_table_php extends XMLDBAction {
|
||||
$o.= $this->str['mustselectonefield'];
|
||||
}
|
||||
break;
|
||||
case 'change_field_enum':
|
||||
if ($fieldkeyindexinitial == 'f') { //Only if we have got one field
|
||||
$o.= s($this->change_field_enum_php($structure, $tableparam, $fieldkeyindexparam));
|
||||
} else {
|
||||
$o.= $this->str['mustselectonefield'];
|
||||
}
|
||||
break;
|
||||
case 'change_field_default':
|
||||
if ($fieldkeyindexinitial == 'f') { //Only if we have got one field
|
||||
$o.= s($this->change_field_default_php($structure, $tableparam, $fieldkeyindexparam));
|
||||
@@ -330,7 +336,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch add field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && add_field($table, $field);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && add_field($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -373,7 +379,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch drop field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && drop_field($table, $field);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && drop_field($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -416,7 +422,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch rename field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && rename_field($table, $field, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && rename_field($table, $field, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -469,7 +475,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch change of type for field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && change_field_type($table, $field);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && change_field_type($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -519,7 +525,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch change of precision for field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && change_field_precision($table, $field);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && change_field_precision($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -565,7 +571,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch change of sign for field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && change_field_unsigned($table, $field);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && change_field_unsigned($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -611,7 +617,54 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch change of nullability for field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && change_field_notnull($table, $field);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && change_field_notnull($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will generate all the PHP code needed to
|
||||
* change the enum values (check constraint) of one field
|
||||
* using XMLDB objects and functions
|
||||
*
|
||||
* @param XMLDBStructure structure object containing all the info
|
||||
* @param string table table name
|
||||
* @param string field field name to change its enum
|
||||
*/
|
||||
function change_field_enum_php($structure, $table, $field) {
|
||||
|
||||
$result = '';
|
||||
/// Validate if we can do it
|
||||
if (!$table = $structure->getTable($table)) {
|
||||
return false;
|
||||
}
|
||||
if (!$field = $table->getField($field)) {
|
||||
return false;
|
||||
}
|
||||
if ($table->getAllErrors()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Calculate the enum tip text
|
||||
$enum = $field->getEnum() ? implode(', ', $field->getEnumValues()) : 'none';
|
||||
|
||||
/// Add the standard PHP header
|
||||
$result .= XMLDB_PHP_HEADER;
|
||||
|
||||
/// Add contents
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Changing list of values (enum) of field ' . $field->getName() . ' on table ' . $table->getName() . ' to ' . $enum . XMLDB_LINEFEED;
|
||||
$result .= ' $table = new XMLDBTable(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
|
||||
$result .= ' $field = new XMLDBField(' . "'" . $field->getName() . "'" . ');' . XMLDB_LINEFEED;
|
||||
$result .= ' $field->setAttributes(' . $field->getPHP(true) . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch change of list of values for field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && change_field_enum($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -657,7 +710,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch change of default for field ' . $field->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && change_field_default($table, $field);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && change_field_default($table, $field);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -701,7 +754,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch add key ' . $key->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && add_key($table, $key);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && add_key($table, $key);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -745,7 +798,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch drop key ' . $key->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && drop_key($table, $key);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && drop_key($table, $key);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -776,6 +829,9 @@ class view_table_php extends XMLDBAction {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Prepend warning. This function isn't usable!
|
||||
$result .= 'DON\'T USE THIS FUNCTION (IT\'S ONLY EXPERIMENTAL). SOME DBs DON\'T SUPPORT IT!' . XMLDB_LINEFEED . XMLDB_LINEFEED;
|
||||
|
||||
/// Add the standard PHP header
|
||||
$result .= XMLDB_PHP_HEADER;
|
||||
|
||||
@@ -789,7 +845,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch rename key ' . $key->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && rename_key($table, $key, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && rename_key($table, $key, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -833,7 +889,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch add index ' . $index->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && add_index($table, $index);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && add_index($table, $index);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -877,7 +933,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch drop index ' . $index->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && drop_index($table, $index);' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && drop_index($table, $index);' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
@@ -908,6 +964,9 @@ class view_table_php extends XMLDBAction {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Prepend warning. This function isn't usable!
|
||||
$result .= 'DON\'T USE THIS FUNCTION (IT\'S ONLY EXPERIMENTAL). SOME DBs DON\'T SUPPORT IT!' . XMLDB_LINEFEED . XMLDB_LINEFEED;
|
||||
|
||||
/// Add the standard PHP header
|
||||
$result .= XMLDB_PHP_HEADER;
|
||||
|
||||
@@ -921,7 +980,7 @@ class view_table_php extends XMLDBAction {
|
||||
/// Launch the proper DDL
|
||||
$result .= XMLDB_LINEFEED;
|
||||
$result .= ' /// Launch rename index ' . $index->getName() . XMLDB_LINEFEED;
|
||||
$result .= ' $status = $status && rename_index($table, $index, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
|
||||
$result .= ' $result = $result && rename_index($table, $index, ' . "'" . 'NEWNAMEGOESHERE' . "'" . ');' . XMLDB_LINEFEED;
|
||||
|
||||
/// Add standard PHP footer
|
||||
$result .= XMLDB_PHP_FOOTER;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
/// getting "incomplete" objects
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once($CFG->libdir.'/ddllib.php'); // Install/upgrade related db functions
|
||||
$adminroot = admin_get_root();
|
||||
admin_externalpage_setup('xmldbeditor', $adminroot);
|
||||
|
||||
|
||||
@@ -159,6 +159,8 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
|
||||
|
||||
reset_login_count();
|
||||
|
||||
load_all_capabilities(); /// This is what lets the user do anything on the site :-)
|
||||
|
||||
redirect($urltogo);
|
||||
|
||||
exit;
|
||||
@@ -266,6 +268,8 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
|
||||
|
||||
reset_login_count();
|
||||
|
||||
load_all_capabilities(); /// This is what lets the user do anything on the site :-)
|
||||
|
||||
redirect($urltogo);
|
||||
|
||||
exit;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
<tr valign="top" class="required">
|
||||
<td align="right">auth_dbtype:</td>
|
||||
<td>
|
||||
<?php $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
|
||||
<?php $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mssql_n", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
|
||||
foreach ($dbtypes as $dbtype) {
|
||||
$dboptions[$dbtype] = $dbtype;
|
||||
}
|
||||
|
||||
+14
-7
@@ -22,7 +22,8 @@ function auth_user_login ($username, $password) {
|
||||
|
||||
// Connect to the external database
|
||||
$authdb = &ADONewConnection($CFG->auth_dbtype);
|
||||
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
|
||||
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
|
||||
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
|
||||
|
||||
if ($CFG->auth_dbpasstype === 'internal') {
|
||||
// lookup username externally, but resolve
|
||||
@@ -92,6 +93,7 @@ function auth_get_userinfo($username){
|
||||
ADOLoadCode($CFG->auth_dbtype);
|
||||
$authdb = &ADONewConnection();
|
||||
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
|
||||
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
|
||||
|
||||
$fields = array("firstname", "lastname", "email", "phone1", "phone2",
|
||||
"department", "address", "city", "country", "description",
|
||||
@@ -101,15 +103,17 @@ function auth_get_userinfo($username){
|
||||
|
||||
foreach ($fields as $field) {
|
||||
if ($pcfg["field_map_$field"]) {
|
||||
if ($rs = $authdb->Execute("SELECT ".$pcfg["field_map_$field"]." FROM $CFG->auth_dbtable
|
||||
if ($rs = $authdb->Execute("SELECT ".$pcfg["field_map_$field"]." as myfield FROM $CFG->auth_dbtable
|
||||
WHERE $CFG->auth_dbfielduser = '$username'")) {
|
||||
if ( $rs->RecordCount() == 1 ) {
|
||||
$fields_obj = rs_fetch_record($rs);
|
||||
if (!empty($CFG->unicodedb)) {
|
||||
$result["$field"] = addslashes(stripslashes($rs->fields[0]));
|
||||
$result["$field"] = addslashes(stripslashes($fields_obj->myfield));
|
||||
} else {
|
||||
$result["$field"] = addslashes(stripslashes(utf8_decode($rs->fields[0])));
|
||||
$result["$field"] = addslashes(stripslashes(utf8_decode($fields_obj->myfield)));
|
||||
}
|
||||
}
|
||||
rs_close($rs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,6 +306,7 @@ function auth_user_exists ($username) {
|
||||
global $CFG;
|
||||
$authdb = &ADONewConnection($CFG->auth_dbtype);
|
||||
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
|
||||
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
|
||||
|
||||
$rs = $authdb->Execute("SELECT * FROM $CFG->auth_dbtable
|
||||
WHERE $CFG->auth_dbfielduser = '$username' ");
|
||||
@@ -334,6 +339,7 @@ function auth_get_userlist() {
|
||||
// Connect to the external database
|
||||
$authdb = &ADONewConnection($CFG->auth_dbtype);
|
||||
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
|
||||
$authdb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection
|
||||
|
||||
// fetch userlist
|
||||
$rs = $authdb->Execute("SELECT $CFG->auth_dbfielduser AS username
|
||||
@@ -347,9 +353,10 @@ function auth_get_userlist() {
|
||||
|
||||
if ( $rs->RecordCount() ) {
|
||||
$userlist = array();
|
||||
while ($rec = $rs->FetchRow()) {
|
||||
array_push($userlist, $rec['username']);
|
||||
while ($rec = rs_fetch_next_record($rs)) {
|
||||
array_push($userlist, $rec->username);
|
||||
}
|
||||
rs_close($rs);
|
||||
return $userlist;
|
||||
} else {
|
||||
return array();
|
||||
@@ -459,4 +466,4 @@ function auth_validate_form(&$form, &$err) {
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,169 +1,85 @@
|
||||
<?php
|
||||
|
||||
if (!isset($config->auth_fchost)) {
|
||||
|
||||
$config->auth_fchost = "127.0.0.1";
|
||||
|
||||
}
|
||||
|
||||
if (!isset($config->auth_fcfppport)) {
|
||||
|
||||
$config->auth_fcfppport = "3333";
|
||||
|
||||
}
|
||||
|
||||
if (!isset($config->auth_fcuserid)) {
|
||||
|
||||
$config->auth_fcuserid = "fcMoodle";
|
||||
|
||||
}
|
||||
|
||||
if (!isset($config->auth_fcpasswd)) {
|
||||
|
||||
$config->auth_fcpasswd = "";
|
||||
|
||||
}
|
||||
|
||||
if (!isset($config->auth_fccreators)) {
|
||||
|
||||
$config->auth_fccreators = "";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<tr valign="top" class="required">
|
||||
|
||||
<td align="right">auth_fchost:</td>
|
||||
|
||||
<td>
|
||||
|
||||
<input name="auth_fchost" type="text" size="30" value="<?php echo $config->auth_fchost?>" />
|
||||
|
||||
<?php if (isset($err["auth_fchost"])) formerr($err["auth_fchost"]); ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php print_string("auth_fchost","auth") ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr valign="top" class="required">
|
||||
|
||||
<td align="right">auth_fcfppport:</td>
|
||||
|
||||
<td>
|
||||
|
||||
<input name="auth_fcfppport" type="text" size="30" value="<?php echo $config->auth_fcfppport?>" />
|
||||
|
||||
<?php if (isset($err["auth_fcfppport"])) formerr($err["auth_fchost"]); ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php print_string("auth_fcfppport","auth") ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr valign="top" class="required">
|
||||
|
||||
<td align="right">auth_fcuserid:</td>
|
||||
|
||||
<td>
|
||||
|
||||
<input name="auth_fcuserid" type="text" size="30" maxlength="15" value="<?php echo $config->auth_fcuserid?>" />
|
||||
|
||||
<?php if (isset($err["auth_fcuserid"])) formerr($err["auth_fcuserid"]); ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php print_string("auth_fcuserid","auth") ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr valign="top" class="required">
|
||||
|
||||
<td align="right">auth_fcpasswd:</td>
|
||||
|
||||
<td>
|
||||
|
||||
<input name="auth_fcpasswd" type="password" size="30" maxlength="12" value="<?php echo $config->auth_fcpasswd?>" />
|
||||
|
||||
<?php if (isset($err["auth_fcpasswd"])) formerr($err["auth_fcpasswd"]); ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php print_string("auth_fcpasswd","auth") ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr valign="top" class="required">
|
||||
|
||||
<td align="right">auth_fccreators:</td>
|
||||
|
||||
<td>
|
||||
|
||||
<input name="auth_fccreators" type="text" size="30" value="<?php echo $config->auth_fccreators?>" />
|
||||
|
||||
<?php if (isset($err["auth_fccreators"])) formerr($err["auth_fccreators"]); ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php print_string("auth_fccreators","auth") ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
<td align="right"><?php print_string("instructions", "auth") ?>:</td>
|
||||
|
||||
<td>
|
||||
|
||||
<textarea name="auth_instructions" cols="30" rows="10" wrap="virtual"><?php p($config->auth_instructions) ?></textarea>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php print_string("authinstructions","auth") ?>
|
||||
|
||||
<?php helpbutton("text", get_string("helptext")) ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php print_auth_lock_options($auth, $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false); ?>
|
||||
|
||||
+7
-6
@@ -108,13 +108,14 @@ class fcFPP
|
||||
if($this->_debug) echo $line;
|
||||
|
||||
if (preg_match ("/^\+0/", $line)) { //+0, user with subadmin privileges
|
||||
$this->_user = $userid;
|
||||
$this->_pwd = $passwd;
|
||||
return TRUE;
|
||||
} elseif (preg_match ("/^\Sorry/",$line)){ //Denied access but a valid user and password
|
||||
$this->_user = $userid;
|
||||
$this->_pwd = $passwd;
|
||||
return TRUE;
|
||||
} elseif (strpos($line, 'You are not allowed')){ // Denied access but a valid user and password
|
||||
// "Sorry. You are not allowed to login with the FPP interface"
|
||||
return TRUE;
|
||||
} else { //Invalid user or password
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -215,4 +216,4 @@ class fcFPP
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
+2
-2
@@ -551,7 +551,7 @@ function auth_sync_users ($bulk_insert_records = 1000, $do_updates=1) {
|
||||
|
||||
}
|
||||
if ( $do_updates && !(empty($updatekeys)) ) { // run updates only if relevant
|
||||
$users = get_records_sql('SELECT u.username, u.id FROM ' . $CFG->prefix . 'user AS u WHERE u.deleted=0 and u.auth=\'' . AUTH_LDAP_NAME . '\'' );
|
||||
$users = get_records_sql('SELECT u.username, u.id FROM ' . $CFG->prefix . 'user u WHERE u.deleted=0 and u.auth=\'' . AUTH_LDAP_NAME . '\'' );
|
||||
if (!empty($users)) {
|
||||
print "User entries to update: ". count($users). "\n";
|
||||
|
||||
@@ -713,7 +713,7 @@ function auth_ldap_bulk_insert($users){
|
||||
// bulk insert -- superfast with $bulk_insert_records
|
||||
$sql = 'INSERT INTO '.$CFG->prefix.'extuser (idnumber) VALUES ';
|
||||
// make those values safe
|
||||
array_map('addslashes', $users);
|
||||
$users = array_map('addslashes', $users);
|
||||
// join and quote the whole lot
|
||||
$sql = $sql . '(\'' . join('\'),(\'', $users) . '\')';
|
||||
print "+ " . count($users) . " users\n";
|
||||
|
||||
@@ -14,7 +14,7 @@ Changes:
|
||||
- 10. 2005: Added better error messages and moved text to language directories
|
||||
- 02. 2006: Simplified authentication so that authorization works properly
|
||||
Added instructions for IIS
|
||||
|
||||
- 11. 2006: User capabilities are now loaded properly as of Moodle 1.7+
|
||||
|
||||
|
||||
Moodle Configuration with Dual login
|
||||
@@ -164,11 +164,6 @@ Example file:
|
||||
?>
|
||||
--
|
||||
|
||||
Bugs
|
||||
--------------------------------------------------------------------------------
|
||||
Please send bug reports concerning the Shibboleth part to
|
||||
Lukas Haemmerle <haemmerle@switch.ch>
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
In case of problems and questions with Shibboleth authentication, contact
|
||||
Lukas Haemmerle <haemmerle@switch.ch> or Markus Hagman <hagman@hytti.uku.fi>
|
||||
|
||||
@@ -56,6 +56,15 @@
|
||||
$urltogo = $CFG->wwwroot.'/'; /// Go to the standard home page
|
||||
unset($SESSION->wantsurl); /// Just in case
|
||||
}
|
||||
|
||||
/// Go to my-moodle page instead of homepage if mymoodleredirect enabled
|
||||
if (!has_capability('moodle/site:config',get_context_instance(CONTEXT_SYSTEM, SITEID)) and !empty($CFG->mymoodleredirect) and !isguest()) {
|
||||
if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {
|
||||
$urltogo = $CFG->wwwroot.'/my/';
|
||||
}
|
||||
}
|
||||
|
||||
load_all_capabilities(); /// This is what lets the user do anything on the site :-)
|
||||
|
||||
redirect($urltogo);
|
||||
}
|
||||
|
||||
+20
-19
@@ -170,25 +170,10 @@
|
||||
return get_users_by_capability(get_context_instance(CONTEXT_COURSE, $courseid), 'moodle/course:view');
|
||||
}
|
||||
|
||||
//Returns all users (every record in users table)
|
||||
|
||||
//Returns all users ids (every record in users table)
|
||||
function backup_get_all_users() {
|
||||
|
||||
global $CFG;
|
||||
|
||||
$result = false;
|
||||
|
||||
//Get users
|
||||
$users = get_records_sql("SELECT DISTINCT id,id
|
||||
FROM {$CFG->prefix}user");
|
||||
//Add users
|
||||
if ($users) {
|
||||
foreach ($users as $user) {
|
||||
$result[$user->id]->id = $user->id;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
return get_records('user', '', '', '', 'id, id');
|
||||
}
|
||||
|
||||
//Calculate the number of log entries to backup
|
||||
@@ -1751,6 +1736,16 @@
|
||||
|
||||
global $CFG,$preferences;
|
||||
|
||||
//Use one static variable to cache all the require_once calls that,
|
||||
//under PHP5 seems to increase load too much, and we are requiring
|
||||
//them here thousands of times (one per content). MDL-8700.
|
||||
//Once fixed by PHP, we'll delete this hack
|
||||
|
||||
static $includedfiles;
|
||||
if (!isset($includedfiles)) {
|
||||
$includedfiles = array();
|
||||
}
|
||||
|
||||
//Check if preferences is ok. If it isn't set, we are
|
||||
//in a scheduled_backup to we are able to get a copy
|
||||
//from CFG->backup_preferences
|
||||
@@ -1770,8 +1765,14 @@
|
||||
$result = str_replace($search,$replace,$content);
|
||||
|
||||
foreach ($mypreferences->mods as $name => $info) {
|
||||
/// We only include the corresponding backuplib.php if it hasn't been included before
|
||||
/// This will save some load under PHP5. MDL-8700.
|
||||
/// Once fixed by PHP, we'll delete this hack
|
||||
if (!in_array($name, $includedfiles)) {
|
||||
include_once("$CFG->dirroot/mod/$name/backuplib.php");
|
||||
$includedfiles[] = $name;
|
||||
}
|
||||
//Check if the xxxx_encode_content_links exists
|
||||
include_once("$CFG->dirroot/mod/$name/backuplib.php");
|
||||
$function_name = $name."_encode_content_links";
|
||||
if (function_exists($function_name)) {
|
||||
$result = $function_name($result,$mypreferences);
|
||||
@@ -2222,4 +2223,4 @@
|
||||
}
|
||||
fwrite ($bf, end_tag("ROLES_ASSIGNMENTS", $startlevel, true));
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
+5
-15
@@ -1,20 +1,9 @@
|
||||
<?php //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// backup/restore utility.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -164,6 +153,7 @@ function backup_upgrade($oldversion=0) {
|
||||
table_column('backup_ids','info','info','mediumtext','','','','not null');
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
rem
|
||||
rem Table structure for table prefix_backup_files
|
||||
rem
|
||||
|
||||
drop table prefix_backup_files;
|
||||
|
||||
CREATE TABLE prefix_backup_files (
|
||||
backup_code number(10) default '0' NOT NULL,
|
||||
file_type varchar2(10) default '' NOT NULL,
|
||||
path varchar2(255) default '' NOT NULL,
|
||||
old_id number(10) default NULL,
|
||||
new_id number(10) default NULL
|
||||
);
|
||||
|
||||
ALTER TABLE prefix_backup_files
|
||||
ADD CONSTRAINT pbf_pk
|
||||
PRIMARY KEY (backup_code,file_type,path);
|
||||
|
||||
COMMENT on table prefix_backup_files is 'To store and recode ids to user and course files.';
|
||||
|
||||
rem --------------------------------------------------------
|
||||
rem
|
||||
rem Table structure for table prefix_backup_ids
|
||||
rem
|
||||
|
||||
drop table prefix_backup_ids;
|
||||
|
||||
CREATE TABLE prefix_backup_ids (
|
||||
backup_code number(12) default '0' NOT NULL,
|
||||
table_name varchar2(30) default '' NOT NULL,
|
||||
old_id number(10) default '0' NOT NULL,
|
||||
new_id number(10) default NULL,
|
||||
info varchar2(20)
|
||||
);
|
||||
|
||||
ALTER TABLE prefix_backup_ids
|
||||
ADD CONSTRAINT pbi_pk
|
||||
PRIMARY KEY (backup_code,table_name,old_id);
|
||||
|
||||
COMMENT on table prefix_backup_ids is 'To store and convert ids in backup/restore';
|
||||
|
||||
rem --------------------------------------------------------
|
||||
rem
|
||||
rem Table structure for table prefix_backup_config
|
||||
rem
|
||||
|
||||
drop TABLE prefix_backup_config;
|
||||
|
||||
CREATE TABLE prefix_backup_config (
|
||||
id number(10) default '0' not null,
|
||||
name varchar2(255) default '' not null,
|
||||
value varchar2(255) default '' not null,
|
||||
constraint pk_baco primary key (id),
|
||||
constraint uk_baco_name unique (name)
|
||||
);
|
||||
|
||||
COMMENT on table prefix_backup_config is 'To store backup configuration variables';
|
||||
|
||||
drop sequence p_backup_config_seq;
|
||||
create sequence p_backup_config_seq;
|
||||
|
||||
create or replace trigger p_backup_config_trig
|
||||
before insert on prefix_backup_config
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_backup_config_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
rem
|
||||
rem Table structure for table prefix_backup_courses
|
||||
rem
|
||||
|
||||
drop TABLE prefix_backup_courses;
|
||||
|
||||
CREATE TABLE prefix_backup_courses (
|
||||
id number(10) default '0' NOT NULL,
|
||||
courseid number(10) default '0' NOT NULL,
|
||||
laststarttime number(10) default '0' NOT NULL,
|
||||
lastendtime number(10) default '0' NOT NULL,
|
||||
laststatus varchar2(1) default '0' NOT NULL,
|
||||
nextstarttime number(10) default '0' NOT NULL,
|
||||
constraint pk_bacu primary key (id),
|
||||
constraint uk_bacu_courseid unique (courseid)
|
||||
);
|
||||
|
||||
COMMENT on table prefix_backup_courses is 'To store every course backup status';
|
||||
|
||||
drop sequence p_backup_courses_seq;
|
||||
create sequence p_backup_courses_seq;
|
||||
|
||||
create or replace trigger p_backup_courses_trig
|
||||
before insert on prefix_backup_courses
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_backup_courses_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
|
||||
rem --------------------------------------------------------
|
||||
rem
|
||||
rem Table structure for table prefix_backup_log
|
||||
rem
|
||||
|
||||
drop TABLE prefix_backup_log;
|
||||
|
||||
CREATE TABLE prefix_backup_log (
|
||||
id number(10) default '0' NOT NULL,
|
||||
courseid number(10) default '0' NOT NULL,
|
||||
time number(10) default '0' NOT NULL,
|
||||
laststarttime number(10) default '0' NOT NULL,
|
||||
info varchar2(255) default '0' NOT NULL,
|
||||
constraint pk_balo primary key (id)
|
||||
);
|
||||
|
||||
COMMENT on table prefix_backup_log is 'To store every course backup log info';
|
||||
|
||||
drop sequence p_backup_log_seq;
|
||||
create sequence p_backup_log_seq;
|
||||
|
||||
create or replace trigger p_backup_log_trig
|
||||
before insert on prefix_backup_log
|
||||
referencing new as new_row
|
||||
for each row
|
||||
begin
|
||||
select p_backup_log_seq.nextval into :new_row.id from dual;
|
||||
end;
|
||||
|
||||
/
|
||||
+6
-16
@@ -1,21 +1,9 @@
|
||||
<?php //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// backup/restore utility.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
//
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
|
||||
function backup_upgrade($oldversion=0) {
|
||||
|
||||
@@ -61,6 +49,8 @@ function backup_upgrade($oldversion=0) {
|
||||
table_column('backup_courses', 'nextstarttime', 'nextstarttime', 'integer', '', '', '0');
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the backup system
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_backup_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
+3
-2
@@ -7,10 +7,11 @@
|
||||
//Sets a name/value pair in backup_config table
|
||||
function backup_set_config($name, $value) {
|
||||
if (get_field("backup_config", "name", "name", $name)) {
|
||||
return set_field("backup_config", "value", $value, "name", $name);
|
||||
return set_field("backup_config", "value", addslashes($value), "name", $name);
|
||||
} else {
|
||||
$config = new object();
|
||||
$config->name = $name;
|
||||
$config->value = $value;
|
||||
$config->value = addslashes($value);
|
||||
return insert_record("backup_config", $config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//Detect if we are coming from the restore form
|
||||
$fromform = optional_param ('fromform', 0, PARAM_INT);
|
||||
|
||||
if ($form1 = data_submitted()); {
|
||||
if ($form1 = data_submitted()) {
|
||||
$currentcourseshortname = $course_header->course_shortname; //"store_ShortName";
|
||||
$course_header->course_shortname = $form1->shortname; //"update_ShortName";
|
||||
$course_header->course_fullname = $form1->fullname; //"update_FullName";
|
||||
@@ -27,6 +27,9 @@
|
||||
$restore->course_startdateoffset = $coursestartdatedateoffset; //change to restore
|
||||
}
|
||||
|
||||
///Enforce SESSION->course_header rewrite (PHP 4.x needed because assigns are by value) MDL-8298
|
||||
$SESSION->course_header = $course_header;
|
||||
|
||||
//If restore session info exists, but we are coming from the form
|
||||
//it has prioriry
|
||||
if (isset($restore) and !empty($fromform)) {
|
||||
|
||||
@@ -54,6 +54,15 @@
|
||||
print_simple_box(get_string("restorefinished"),"center");
|
||||
} else {
|
||||
print_simple_box(get_string("importdatafinished"),"center");
|
||||
$file = $CFG->dataroot . '/'
|
||||
. $SESSION->import_preferences->backup_course
|
||||
. '/backupdata/' . $SESSION->import_preferences->backup_name;
|
||||
if (is_readable($file)) {
|
||||
unlink($file);
|
||||
}
|
||||
else {
|
||||
error_log("import course data: couldn't unlink $file");
|
||||
}
|
||||
unset($SESSION->restore);
|
||||
}
|
||||
print_continue("$CFG->wwwroot/course/view.php?id=".$restore->course_id);
|
||||
|
||||
@@ -169,15 +169,16 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
|
||||
echo "<td align=\"right\"><b>";
|
||||
echo get_string("restoreto").":</b>";
|
||||
echo "</td><td colspan=\"3\">";
|
||||
if (!has_capability('moodle/course:create', get_context_instance(CONTEXT_COURSE, $id))) {
|
||||
$restore_restoreto_options[0] = get_string("currentcoursedeleting");
|
||||
$restore_restoreto_options[1] = get_string("currentcourseadding");
|
||||
}
|
||||
|
||||
if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
|
||||
$restore_restoreto_options[0] = get_string("existingcoursedeleting");
|
||||
$restore_restoreto_options[1] = get_string("existingcourseadding");
|
||||
$restore_restoreto_options[2] = get_string("newcourse");
|
||||
} else { // fix for MDL-7773
|
||||
$restore_restoreto_options[0] = get_string("currentcoursedeleting");
|
||||
$restore_restoreto_options[1] = get_string("currentcourseadding");
|
||||
}
|
||||
|
||||
choose_from_menu($restore_restoreto_options, "restore_restoreto", $restore_restoreto, "");
|
||||
echo "</td></tr>";
|
||||
if (iscreator()) { //display these fields conditionally
|
||||
@@ -266,7 +267,9 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
|
||||
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\" />";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
$instances = $info->mods[$modname]->instances;
|
||||
if (isset($info->mods[$modname]->instances)) {
|
||||
$instances = $info->mods[$modname]->instances;
|
||||
}
|
||||
if (!empty($instances) && is_array($instances)) {
|
||||
echo '<tr><td></td><td colspan="3"><table class="restore-form-instances">';
|
||||
foreach ($instances as $instance) {
|
||||
@@ -422,7 +425,11 @@ $xml_file = $CFG->dataroot."/temp/backup/".$backup_unique_code."/moodle.xml";
|
||||
|
||||
$info = restore_read_xml_info($xml_file);
|
||||
|
||||
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "shortname");
|
||||
if ($course->id == SITEID) {
|
||||
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_SYSTEM, SITEID), "shortname");
|
||||
} else {
|
||||
$siterolesarray = get_assignable_roles (get_context_instance(CONTEXT_COURSE, $course->id), "shortname");
|
||||
}
|
||||
|
||||
echo ('<table width="100%" class="restore-form-instances">');
|
||||
echo ('<tr><td align="right"><b>'.get_string('sourcerole').'</b></td><td align="left"><b>'.get_string('targetrole').'</b></td></tr>');
|
||||
@@ -439,7 +446,7 @@ if ($info->backup_moodle_version < 2006092801) {
|
||||
$roles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
|
||||
|
||||
$editteacher = array_shift($roles);
|
||||
choose_from_menu ($siterolesarray, "defaultteacheredit", $editteacher->id);
|
||||
choose_from_menu ($siterolesarray, "defaultteacheredit", $editteacher->id, 'new role', '', '0');
|
||||
echo ('</td></tr>');
|
||||
|
||||
/// Non-editting teacher
|
||||
@@ -451,7 +458,7 @@ if ($info->backup_moodle_version < 2006092801) {
|
||||
$roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
|
||||
$teacher = array_shift($roles);
|
||||
|
||||
choose_from_menu ($siterolesarray, "defaultteacher", $teacher->id);
|
||||
choose_from_menu ($siterolesarray, "defaultteacher", $teacher->id, 'new role', '', '0');
|
||||
echo ('</td></tr>');
|
||||
|
||||
|
||||
@@ -464,7 +471,7 @@ if ($info->backup_moodle_version < 2006092801) {
|
||||
$roles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID));
|
||||
$studentrole = array_shift($roles);
|
||||
|
||||
choose_from_menu ($siterolesarray, "defaultstudent", $studentrole->id);
|
||||
choose_from_menu ($siterolesarray, "defaultstudent", $studentrole->id, 'new role', '', '0');
|
||||
echo ('</td></tr>');
|
||||
|
||||
} else {
|
||||
|
||||
+114
-48
@@ -45,7 +45,7 @@
|
||||
//Iterate
|
||||
foreach($modules as $name => $module) {
|
||||
//Only if the module is being restored
|
||||
if ($module->restore == 1) {
|
||||
if (isset($module->restore) && $module->restore == 1) {
|
||||
//Include module library
|
||||
include_once("$CFG->dirroot/mod/$name/lib.php");
|
||||
//If module_refresh_events exists
|
||||
@@ -72,7 +72,7 @@
|
||||
}
|
||||
foreach ($restore->mods as $name => $info) {
|
||||
//If the module is being restored
|
||||
if ($info->restore == 1) {
|
||||
if (isset($info->restore) && $info->restore == 1) {
|
||||
//Check if the xxxx_decode_content_links_caller exists
|
||||
include_once("$CFG->dirroot/mod/$name/restorelib.php");
|
||||
$function_name = $name."_decode_content_links_caller";
|
||||
@@ -365,7 +365,7 @@
|
||||
} else {
|
||||
$tab[$elem][1] = get_string("included")." ".get_string("withoutuserdata");
|
||||
}
|
||||
if (is_array($mod->instances) && count($mod->instances)) {
|
||||
if (isset($mod->instances) && is_array($mod->instances) && count($mod->instances)) {
|
||||
foreach ($mod->instances as $instance) {
|
||||
if ($instance->backup) {
|
||||
$elem++;
|
||||
@@ -565,7 +565,7 @@
|
||||
$course->lang = addslashes($course_header->course_lang);
|
||||
$course->theme = addslashes($course_header->course_theme);
|
||||
$course->cost = addslashes($course_header->course_cost);
|
||||
$course->currency = addslashes($course_header->course_currency);
|
||||
$course->currency = isset($course_header->course_currency)?addslashes($course_header->course_currency):'';
|
||||
$course->marker = addslashes($course_header->course_marker);
|
||||
$course->visible = addslashes($course_header->course_visible);
|
||||
$course->hiddensections = addslashes($course_header->course_hiddensections);
|
||||
@@ -901,7 +901,7 @@
|
||||
// Yu: This part is called repeatedly for every instance,
|
||||
// so it is necessary to set the granular flag and check isset()
|
||||
// when the first instance of this type of mod is processed.
|
||||
if (!isset($restore->mods[$mod->type]->granular) && is_array($restore->mods[$mod->type]->instances)) {
|
||||
if (!isset($restore->mods[$mod->type]->granular) && isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
|
||||
// This defines whether we want to restore specific
|
||||
// instances of the modules (granular restore), or
|
||||
// whether we don't care and just want to restore
|
||||
@@ -912,7 +912,7 @@
|
||||
}
|
||||
|
||||
//Check if we've to restore this module (and instance)
|
||||
if ($restore->mods[$mod->type]->restore) {
|
||||
if (!empty($restore->mods[$mod->type]->restore)) {
|
||||
if (empty($restore->mods[$mod->type]->granular) // we don't care about per instance
|
||||
|| (array_key_exists($mod->instance,$restore->mods[$mod->type]->instances)
|
||||
&& !empty($restore->mods[$mod->type]->instances[$mod->instance]->restore))) {
|
||||
@@ -1913,14 +1913,7 @@
|
||||
foreach ($info as $category) {
|
||||
//Skip empty categories (some backups can contain them)
|
||||
if (!empty($category->id)) {
|
||||
$catrestore = "restore_question_categories";
|
||||
if (function_exists($catrestore)) {
|
||||
//print_object ($category); //Debug
|
||||
$status = $catrestore($category,$restore);
|
||||
} else {
|
||||
//Something was wrong. Function should exist.
|
||||
$status = false;
|
||||
}
|
||||
$status = restore_question_categories($category,$restore);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1932,15 +1925,14 @@
|
||||
if ($categories) {
|
||||
foreach ($categories as $category) {
|
||||
$restoredcategory = get_record('question_categories','id',$category->new_id);
|
||||
$restoredcategory = addslashes_object($restoredcategory);
|
||||
if ($restoredcategory->parent != 0) {
|
||||
//echo 'Parent '.$restoredcategory->parent.' is '; //Debug
|
||||
$idcat = backup_getid($restore->backup_unique_code,'question_categories',$restoredcategory->parent);
|
||||
if ($idcat->new_id) {
|
||||
$restoredcategory->parent = $idcat->new_id;
|
||||
} else {
|
||||
$restoredcategory->parent = 0;
|
||||
}
|
||||
//echo $restoredcategory->parent.' now<br />'; //Debug
|
||||
update_record('question_categories', $restoredcategory);
|
||||
}
|
||||
}
|
||||
@@ -2205,10 +2197,7 @@
|
||||
//Get admin->id for later use
|
||||
$admin = get_admin();
|
||||
$adminid = $admin->id;
|
||||
//First, we check the course_id backup data folder exists
|
||||
$dest_dir = $CFG->dataroot."/".$restore->course_id."/backupdata";
|
||||
check_dir_exists($dest_dir,true);
|
||||
$restorelog_file = fopen("$dest_dir/restorelog.html","a");
|
||||
|
||||
//Now, if we have anything in events, we have to restore that
|
||||
//events
|
||||
if ($events) {
|
||||
@@ -2227,6 +2216,11 @@
|
||||
//print_object ($GLOBALS['traverse_array']); //Debug
|
||||
//$GLOBALS['traverse_array']=""; //Debug
|
||||
|
||||
//if necessary, write to restorelog and adjust date/time fields
|
||||
if ($restore->course_startdateoffset) {
|
||||
restore_log_date_changes('Events', $restore, $info['EVENT']['#'], array('TIMESTART'));
|
||||
}
|
||||
|
||||
//Now build the EVENT record structure
|
||||
$eve->name = backup_todb($info['EVENT']['#']['NAME']['0']['#']);
|
||||
$eve->description = backup_todb($info['EVENT']['#']['DESCRIPTION']['0']['#']);
|
||||
@@ -2239,11 +2233,6 @@
|
||||
$eve->instance = 0;
|
||||
$eve->eventtype = backup_todb($info['EVENT']['#']['EVENTTYPE']['0']['#']);
|
||||
$eve->timestart = backup_todb($info['EVENT']['#']['TIMESTART']['0']['#']);
|
||||
$date = usergetdate($eve->timestart);
|
||||
fwrite ($restorelog_file,"The Event - ".$eve->name. " - TIMESTART was " .$date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."");
|
||||
$eve->timestart += $restore->course_startdateoffset;
|
||||
$date = usergetdate($eve->timestart);
|
||||
fwrite ($restorelog_file," the Event TIMESTART is now " .$date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."<br>");
|
||||
$eve->timeduration = backup_todb($info['EVENT']['#']['TIMEDURATION']['0']['#']);
|
||||
$eve->visible = backup_todb($info['EVENT']['#']['VISIBLE']['0']['#']);
|
||||
$eve->timemodified = backup_todb($info['EVENT']['#']['TIMEMODIFIED']['0']['#']);
|
||||
@@ -4415,7 +4404,7 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($this->level == 6 && $this->tree[5]!="ROLE_ASSIGNMENTS" && $this->tree[5]!="ROLE_OVERRIDES") {
|
||||
if ($this->level == 6 && $this->tree[5]!="ROLES_ASSIGNMENTS" && $this->tree[5]!="ROLES_OVERRIDES") {
|
||||
switch ($tagName) {
|
||||
case "ROLE":
|
||||
//We've finalized a role, get it
|
||||
@@ -4430,7 +4419,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->level == 7 && $this->tree[5]!="ROLE_ASSIGNMENTS" && $this->tree[5]!="ROLE_OVERRIDES") {
|
||||
if ($this->level == 7) {
|
||||
switch ($tagName) {
|
||||
case "TYPE":
|
||||
$this->info->temprole->type = $this->getContents();
|
||||
@@ -4901,7 +4890,7 @@
|
||||
$mod_id = $data["MOD"]["#"]["ID"]["0"]["#"];
|
||||
$mod_type = $data["MOD"]["#"]["MODTYPE"]["0"]["#"];
|
||||
//Only if we've selected to restore it
|
||||
if ($this->preferences->mods[$mod_type]->restore) {
|
||||
if (!empty($this->preferences->mods[$mod_type]->restore)) {
|
||||
//Save to db
|
||||
$status = backup_putid($this->preferences->backup_unique_code,$mod_type,$mod_id,
|
||||
null,$data);
|
||||
@@ -5350,7 +5339,7 @@
|
||||
*/
|
||||
function restore_userdata_selected($restore,$modname,$modid) {
|
||||
// check first for per instance array
|
||||
if (!empty($restore->mods[$modname]->instances)) { // supports per instance
|
||||
if (!empty($restore->mods[$modname]->granular)) { // supports per instance
|
||||
return array_key_exists($modid,$restore->mods[$modname]->instances)
|
||||
&& !empty($restore->mods[$modname]->instances[$modid]->userinfo);
|
||||
}
|
||||
@@ -5878,7 +5867,7 @@
|
||||
// would have loaded it anyway, if there is any assignments.
|
||||
// fix for MDL-6831
|
||||
$newcontext = get_context_instance(CONTEXT_COURSE, $restore->course_id);
|
||||
if (!has_capability('course:manageactivities', $newcontext)) {
|
||||
if (!has_capability('moodle/course:manageactivities', $newcontext)) {
|
||||
if ($legacyteachers = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, get_context_instance(CONTEXT_SYSTEM, SITEID))) {
|
||||
if ($legacyteacher = array_shift($legacyteachers)) {
|
||||
role_assign($legacyteacher->id, $USER->id, 0, $newcontext->id);
|
||||
@@ -6016,12 +6005,24 @@
|
||||
// the following code creates new roles
|
||||
// but we could use more intelligent detection, and role mapping
|
||||
// get role mapping info from $restore
|
||||
$rolemappings = array();
|
||||
|
||||
$rolemappings = $restore->rolesmapping; // an array
|
||||
if ($info->roles) {
|
||||
foreach ($info->roles as $oldroleid=>$roledata) {
|
||||
if (!empty($restore->rolesmapping)) {
|
||||
$rolemappings = $restore->rolesmapping;
|
||||
}
|
||||
// $info->roles will be empty for backups pre 1.7
|
||||
if (isset($info->roles) && $info->roles) {
|
||||
|
||||
/// first we check if the roles are in the mappings
|
||||
foreach ($info->roles as $oldroleid=>$roledata) {
|
||||
if (empty($restore->rolesmapping)) {
|
||||
// if this is empty altogether, we came from import or there's no roles used in course at all
|
||||
// in this case, write the same oldid as this is the same site
|
||||
// no need to do mapping
|
||||
$status = backup_putid($restore->backup_unique_code,"role",$oldroleid,
|
||||
$oldroleid); // adding a new id
|
||||
continue; // do not create additonal roles;
|
||||
}
|
||||
// first we check if the roles are in the mappings
|
||||
// if so, we just do a mapping i.e. update oldids table
|
||||
if (isset($rolemappings[$oldroleid]) && $rolemappings[$oldroleid]) {
|
||||
$status = backup_putid($restore->backup_unique_code,"role",$oldroleid,
|
||||
@@ -6057,7 +6058,7 @@
|
||||
|
||||
// done finding a unique name
|
||||
|
||||
$newroleid = create_role($roledata->name,$roledata->shortname,'');
|
||||
$newroleid = create_role(addslashes($roledata->name),addslashes($roledata->shortname),'');
|
||||
$status = backup_putid($restore->backup_unique_code,"role",$oldroleid,
|
||||
$newroleid); // adding a new id
|
||||
foreach ($roledata->capabilities as $capability) {
|
||||
@@ -6073,7 +6074,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6093,7 +6093,13 @@
|
||||
}
|
||||
$course = restore_read_xml_course_header($xmlfile);
|
||||
|
||||
if (!empty($course->roleassignments)) {
|
||||
if (!isset($restore->rolesmapping)) {
|
||||
$isimport = true; // course import from another course, or course with no role assignments
|
||||
} else {
|
||||
$isimport = false; // course restore with role assignments
|
||||
}
|
||||
|
||||
if (!empty($course->roleassignments) && !$isimport) {
|
||||
$courseassignments = $course->roleassignments;
|
||||
|
||||
foreach ($courseassignments as $oldroleid => $courseassignment) {
|
||||
@@ -6104,14 +6110,12 @@
|
||||
* Restoring from course level overrides *
|
||||
*****************************************************/
|
||||
|
||||
if (!empty($course->roleoverrides)) {
|
||||
if (!empty($course->roleoverrides) && !$isimport) {
|
||||
$courseoverrides = $course->roleoverrides;
|
||||
$rolemappings = $restore->rolesmapping;
|
||||
foreach ($courseoverrides as $oldroleid => $courseoverride) {
|
||||
|
||||
// if not importing into exiting course, or creating new role, we are ok
|
||||
// local course overrides to be respected (i.e. restored course overrides ignored)
|
||||
if ($restore->restoreto != 1 || empty($rolemappings[$oldroleid])) {
|
||||
if ($restore->restoreto != 1 || empty($restore->rolesmapping[$oldroleid])) {
|
||||
restore_write_roleoverrides($restore, $courseoverride->overrides, "course", CONTEXT_COURSE, $course->course_id, $oldroleid);
|
||||
}
|
||||
}
|
||||
@@ -6131,11 +6135,12 @@
|
||||
foreach ($secs as $section) {
|
||||
if (isset($section->mods)) {
|
||||
foreach ($section->mods as $modid=>$mod) {
|
||||
if (isset($mod->roleassignments)) {
|
||||
if (isset($mod->roleassignments) && !$isimport) {
|
||||
foreach ($mod->roleassignments as $oldroleid=>$modassignment) {
|
||||
restore_write_roleassignments($restore, $modassignment->assignments, "course_modules", CONTEXT_MODULE, $modid, $oldroleid);
|
||||
}
|
||||
}
|
||||
// role overrides always applies, in import or backup/restore
|
||||
if (isset($mod->roleoverrides)) {
|
||||
foreach ($mod->roleoverrides as $oldroleid=>$modoverride) {
|
||||
restore_write_roleoverrides($restore, $modoverride->overrides, "course_modules", CONTEXT_MODULE, $modid, $oldroleid);
|
||||
@@ -6157,13 +6162,14 @@
|
||||
$blocks = restore_read_xml_blocks($xmlfile);
|
||||
if (isset($blocks->instances)) {
|
||||
foreach ($blocks->instances as $instance) {
|
||||
if (isset($instance->roleassignments)) {
|
||||
if (isset($instance->roleassignments) && !$isimport) {
|
||||
foreach ($instance->roleassignments as $oldroleid=>$blockassignment) {
|
||||
restore_write_roleassignments($restore, $blockassignment->assignments, "block_instance", CONTEXT_BLOCK, $instance->id, $oldroleid);
|
||||
|
||||
}
|
||||
}
|
||||
if (isset($instance->roleoverrides)) {
|
||||
// likewise block overrides should always be restored like mods
|
||||
if (isset($instance->roleoverrides)) {
|
||||
foreach ($instance->roleoverrides as $oldroleid=>$blockoverride) {
|
||||
restore_write_roleoverrides($restore, $blockoverride->overrides, "block_instance", CONTEXT_BLOCK, $instance->id, $oldroleid);
|
||||
}
|
||||
@@ -6179,7 +6185,7 @@
|
||||
echo "<li>".get_string("creatinguserroles").'</li>';
|
||||
}
|
||||
$info = restore_read_xml_users($restore, $xmlfile);
|
||||
if (!empty($info->users)) {
|
||||
if (!empty($info->users) && !$isimport) { // no need to restore user assignments for imports (same course)
|
||||
//For each user, take its info from backup_ids
|
||||
foreach ($info->users as $userid) {
|
||||
$rec = backup_getid($restore->backup_unique_code,"user",$userid);
|
||||
@@ -6212,7 +6218,7 @@
|
||||
}
|
||||
$assignment->userid = $olduser->new_id; // new userid here
|
||||
$oldmodifier = backup_getid($restore->backup_unique_code,"user",$assignment->modifierid);
|
||||
$assignment->modifierid = $oldmodifier->new_id?$oldmodifier->new_id:0; // new modifier id here
|
||||
$assignment->modifierid = !empty($oldmodifier->new_id) ? $oldmodifier->new_id : 0; // new modifier id here
|
||||
$assignment->roleid = $role->new_id; // restored new role id
|
||||
|
||||
// hack to make the correct contextid for course level imports
|
||||
@@ -6259,5 +6265,65 @@
|
||||
insert_record('role_capabilities', $override);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
//write activity date changes to the html log file, and update date values in the the xml array
|
||||
function restore_log_date_changes($recordtype, &$restore, &$xml, $TAGS, $NAMETAG='NAME') {
|
||||
|
||||
global $CFG;
|
||||
$openlog = false;
|
||||
|
||||
// loop through time fields in $TAGS
|
||||
foreach ($TAGS as $TAG) {
|
||||
|
||||
// check $TAG has a sensible value
|
||||
if (!empty($xml[$TAG][0]['#']) && is_string($xml[$TAG][0]['#']) && is_numeric($xml[$TAG][0]['#'])) {
|
||||
|
||||
if ($openlog==false) {
|
||||
$openlog = true; // only come through here once
|
||||
|
||||
// open file for writing
|
||||
$course_dir = "$CFG->dataroot/$restore->course_id/backupdata";
|
||||
check_dir_exists($course_dir, true);
|
||||
$restorelog = fopen("$course_dir/restorelog.html", "a");
|
||||
|
||||
// start output for this record
|
||||
$msg = new stdClass();
|
||||
$msg->recordtype = $recordtype;
|
||||
$msg->recordname = $xml[$NAMETAG][0]['#'];
|
||||
fwrite ($restorelog, get_string("backupdaterecordtype", "moodle", $msg));
|
||||
}
|
||||
|
||||
// write old date to $restorelog
|
||||
$value = $xml[$TAG][0]['#'];
|
||||
$date = usergetdate($value);
|
||||
|
||||
$msg = new stdClass();
|
||||
$msg->TAG = $TAG;
|
||||
$msg->weekday = $date['weekday'];
|
||||
$msg->mday = $date['mday'];
|
||||
$msg->month = $date['month'];
|
||||
$msg->year = $date['year'];
|
||||
fwrite ($restorelog, get_string("backupdateold", "moodle", $msg));
|
||||
|
||||
// write new date to $restorelog
|
||||
$value += $restore->course_startdateoffset;
|
||||
$date = usergetdate($value);
|
||||
|
||||
$msg = new stdClass();
|
||||
$msg->TAG = $TAG;
|
||||
$msg->weekday = $date['weekday'];
|
||||
$msg->mday = $date['mday'];
|
||||
$msg->month = $date['month'];
|
||||
$msg->year = $date['year'];
|
||||
fwrite ($restorelog, get_string("backupdatenew", "moodle", $msg));
|
||||
|
||||
// update $value in $xml tree for calling module
|
||||
$xml[$TAG][0]['#'] = "$value";
|
||||
}
|
||||
}
|
||||
// close the restore log, if it was opened
|
||||
if ($openlog) {
|
||||
fclose($restorelog);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
/// database (backup_version) to determine whether upgrades should
|
||||
/// be performed (see db/backup_*.php)
|
||||
|
||||
$backup_version = 2006082301; // The current version is a date (YYYYMMDDXX)
|
||||
$backup_release = "1.7dev"; // User-friendly version number
|
||||
$backup_version = 2006082304; // The current version is a date (YYYYMMDDXX)
|
||||
$backup_release = "1.7"; // User-friendly version number
|
||||
|
||||
?>
|
||||
|
||||
-1232
File diff suppressed because it is too large
Load Diff
@@ -1,20 +1,8 @@
|
||||
<?PHP //$Id$
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +16,8 @@ function activity_modules_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function activity_modules_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the activity_modules block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_activity_modules_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -57,7 +57,7 @@ class block_admin extends block_list {
|
||||
$this->content->items[]='<a href="view.php?id='.$this->instance->pageid.'&edit=on&sesskey='.sesskey().'">'.get_string('turneditingon').'</a>';
|
||||
}
|
||||
|
||||
$this->content->items[]='<a href="edit.php?id='.$this->instance->pageid.'">'.get_string('settings').'</a>';
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/edit.php?id='.$this->instance->pageid.'">'.get_string('settings').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/settings.gif" alt="" />';
|
||||
}
|
||||
|
||||
@@ -143,16 +143,16 @@ class block_admin extends block_list {
|
||||
}
|
||||
|
||||
/// Authorize hooks
|
||||
if (has_capability('enrol/authorize:managepayments', $context)) {
|
||||
if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
|
||||
require_once($CFG->dirroot.'/enrol/authorize/const.php');
|
||||
$paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a> ';
|
||||
if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
|
||||
require_once($CFG->dirroot.'/enrol/authorize/const.php');
|
||||
$paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a> ';
|
||||
if (has_capability('enrol/authorize:managepayments', $context)) {
|
||||
if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH, 'courseid', $course->id)) {
|
||||
$paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'&course='.$course->id.'">'.get_string('paymentpending', 'moodle', $cnt).'</a>';
|
||||
}
|
||||
$this->content->items[] = $paymenturl;
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" alt="" />';
|
||||
}
|
||||
$this->content->items[] = $paymenturl;
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" alt="" />';
|
||||
}
|
||||
|
||||
/// View course grades (or just your own grades, same link)
|
||||
@@ -162,14 +162,16 @@ class block_admin extends block_list {
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/grades.gif" alt="" />';
|
||||
}
|
||||
|
||||
/// Person can unenrol themselves from this course
|
||||
if (has_capability('moodle/role:unassignself', $context, NULL, false) and empty($course->metacourse)) {
|
||||
$this->content->items[]='<a href="unenrol.php?id='.$this->instance->pageid.'">'.get_string('unenrolme', '', $course->shortname).'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
|
||||
if (empty($course->metacourse)) {
|
||||
if (has_capability('moodle/legacy:guest', $context, NULL, false)) { // Are a guest now
|
||||
$this->content->items[]='<a href="enrol.php?id='.$this->instance->pageid.'">'.get_string('enrolme', '', $course->shortname).'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
|
||||
} else if (has_capability('moodle/role:unassignself', $context, NULL, false)) { // Have some role
|
||||
$this->content->items[]='<a href="unenrol.php?id='.$this->instance->pageid.'">'.get_string('unenrolme', '', $course->shortname).'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Should the following two be in this block?
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function admin_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function admin_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the admin block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_admin_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -57,7 +57,10 @@ class block_admin_bookmarks extends block_base {
|
||||
$bookmarks = array();
|
||||
}
|
||||
|
||||
if (($section = (isset($PAGE->section) ? $PAGE->section : '')) && (in_array($section, $bookmarks))) {
|
||||
if(isset($PAGE->section) and $PAGE->section == 'search'){
|
||||
// the search page can't be properly bookmarked at present
|
||||
$this->content->footer = '';
|
||||
}elseif (($section = (isset($PAGE->section) ? $PAGE->section : '')) && (in_array($section, $bookmarks))) {
|
||||
$this->content->footer = '<a href="' . $CFG->wwwroot . '/blocks/admin_bookmarks/delete.php?section=' . $section . '&sesskey='.sesskey().'">' . get_string('unbookmarkthispage','admin') . '</a>';
|
||||
} elseif ($section = (isset($PAGE->section) ? $PAGE->section : '')) {
|
||||
$this->content->footer = '<a href="' . $CFG->wwwroot . '/blocks/admin_bookmarks/create.php?section=' . $section . '&sesskey='.sesskey().'">' . get_string('bookmarkthispage','admin') . '</a>';
|
||||
|
||||
@@ -88,8 +88,8 @@ class block_blog_menu extends block_base {
|
||||
&& (!$blogmodon || ($blogmodon && $coursearg != ''))
|
||||
&& $CFG->bloglevel >= BLOG_USER_LEVEL ) {
|
||||
|
||||
// show Add entry link - moderation is off, or moderation is on and the user is viewing the block within the context of a course
|
||||
if (has_capability('moodle/blog:create', $curcontext)) {
|
||||
// show Add entry link
|
||||
if (has_capability('moodle/blog:create', $sitecontext)) {
|
||||
$addentrylink = '<li><a href="'. $CFG->wwwroot. '/blog/edit.php?action=add'
|
||||
.$coursearg.'">'.get_string('addnewentry', 'blog') ."</a></li>\n";
|
||||
}
|
||||
@@ -113,9 +113,9 @@ class block_blog_menu extends block_base {
|
||||
$output .= get_string('viewsiteentries', 'blog')."</a></li>\n";
|
||||
}
|
||||
|
||||
if (isloggedin() && !isguest()
|
||||
&& (has_capability('moodle/blog:manageofficialtags', $sitecontext)
|
||||
|| has_capability('moodle/blog:managepersonaltags', $curcontext))) {
|
||||
if (has_capability('moodle/blog:manageofficialtags', $sitecontext)
|
||||
or has_capability('moodle/blog:managepersonaltags', $sitecontext)
|
||||
or has_capability('moodle/blog:create', $sitecontext)) {
|
||||
|
||||
$output .= '<li>'. link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement'), 400, 500, 'Popup window', 'none', true) ."</li>\n";
|
||||
}
|
||||
|
||||
@@ -77,16 +77,15 @@ class block_blog_tags extends block_base {
|
||||
$timewithin = $this->config->timewithin * 24 * 60 * 60; /// convert to seconds
|
||||
|
||||
$sql = 'SELECT t.id, t.type, t.text, COUNT(DISTINCT bt.id) as ct ';
|
||||
$sql .= "FROM {$CFG->prefix}tags as t, {$CFG->prefix}blog_tag_instance as bt, {$CFG->prefix}post as p ";
|
||||
$sql .= "FROM {$CFG->prefix}tags t, {$CFG->prefix}blog_tag_instance bt, {$CFG->prefix}post p ";
|
||||
$sql .= 'WHERE t.id = bt.tagid ';
|
||||
$sql .= 'AND p.id = bt.entryid ';
|
||||
$sql .= 'AND (p.publishstate = \'site\' or p.publishstate=\'public\') ';
|
||||
$sql .= "AND bt.timemodified > {$timewithin} ";
|
||||
$sql .= 'GROUP BY t.id, t.type, t.text ';
|
||||
$sql .= 'ORDER BY ct DESC, t.text ASC ';
|
||||
$sql .= "LIMIT {$this->config->numberoftags} ";
|
||||
$sql .= 'ORDER BY ct DESC, t.text ASC';
|
||||
|
||||
if ($tags = get_records_sql($sql)) {
|
||||
if ($tags = get_records_sql($sql, 0, $this->config->numberoftags)) {
|
||||
|
||||
/// There are 2 things to do:
|
||||
/// 1. tags with the same count should have the same size class
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function calendar_month_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function calendar_month_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the calendar_month block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_calendar_month_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function calendar_upcoming_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function calendar_upcoming_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the calendar_upcoming block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_calendar_upcoming_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -36,7 +36,7 @@ class block_course_list extends block_list {
|
||||
|
||||
if (empty($CFG->disablemycourses) and
|
||||
!empty($USER->id) and
|
||||
!(has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM, SITEID)) and $adminseesall)and
|
||||
!(has_capability('moodle/course:update', get_context_instance(CONTEXT_SYSTEM)) and $adminseesall) and
|
||||
!isguest()) { // Just print My Courses
|
||||
if ($courses = get_my_courses($USER->id)) {
|
||||
foreach ($courses as $course) {
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function course_list_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function course_list_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the course_list block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_course_list_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function course_summary_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function course_summary_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the course_summary block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_course_summary_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
+24
-18
@@ -15,8 +15,13 @@ function migrate2utf8_block_instance_configdata($recordid){
|
||||
$fromenc = $globallang;
|
||||
} else {
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($blockinstance->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockinstance->pageid); //N.E.!!
|
||||
if ($blockinstance->pagetype == 'course-view') {
|
||||
$courselang = get_course_lang($blockinstance->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockinstance->pageid); //N.E.!!
|
||||
} else {
|
||||
$courselang = false;
|
||||
$userlang = false;
|
||||
}
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
}
|
||||
@@ -42,8 +47,13 @@ function migrate2utf8_block_instance_configdata($recordid){
|
||||
$fromenc = $globallang;
|
||||
} else {
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($blockinstance->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockinstance->pageid); //N.E.!!
|
||||
if ($blockinstance->pagetype == 'course-view') {
|
||||
$courselang = get_course_lang($blockinstance->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockinstance->pageid); //N.E.!!
|
||||
} else {
|
||||
$courselang = false;
|
||||
$userlang = false;
|
||||
}
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
}
|
||||
@@ -68,8 +78,13 @@ function migrate2utf8_block_instance_configdata($recordid){
|
||||
$fromenc = $globallang;
|
||||
} else {
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($blockinstance->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockinstance->pageid); //N.E.!!
|
||||
if ($blockinstance->pagetype == 'course-view') {
|
||||
$courselang = get_course_lang($blockinstance->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockinstance->pageid); //N.E.!!
|
||||
} else {
|
||||
$courselang = false;
|
||||
$userlang = false;
|
||||
}
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
}
|
||||
@@ -110,10 +125,7 @@ global $CFG, $globallang;
|
||||
$fromenc = $globallang;
|
||||
} else {
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($blockpinned->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockpinned->pageid); //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
$fromenc = get_original_encoding($sitelang, false, false);
|
||||
}
|
||||
|
||||
$blah = unserialize(base64_decode($blockpinned->configdata));
|
||||
@@ -137,10 +149,7 @@ global $CFG, $globallang;
|
||||
$fromenc = $globallang;
|
||||
} else {
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($blockpinned->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockpinned->pageid); //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
$fromenc = get_original_encoding($sitelang, false, false);
|
||||
}
|
||||
|
||||
$blah = unserialize(base64_decode($blockpinned->configdata));
|
||||
@@ -163,10 +172,7 @@ global $CFG, $globallang;
|
||||
$fromenc = $globallang;
|
||||
} else {
|
||||
$sitelang = $CFG->lang;
|
||||
$courselang = get_course_lang($blockpinned->pageid); //Non existing!
|
||||
$userlang = get_main_teacher_lang($blockpinned->pageid); //N.E.!!
|
||||
|
||||
$fromenc = get_original_encoding($sitelang, $courselang, $userlang);
|
||||
$fromenc = get_original_encoding($sitelang, false, false);
|
||||
}
|
||||
|
||||
$blah = unserialize(base64_decode($blockpinned->configdata));
|
||||
|
||||
+6
-15
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -161,6 +150,8 @@ global $CFG;
|
||||
modify_database('','ALTER TABLE prefix_block_pinned ADD INDEX pagetype (pagetype);');
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
+6
-15
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -163,6 +152,8 @@ global $CFG;
|
||||
modify_database('','CREATE INDEX prefix_block_pinned_pagetype_idx ON prefix_block_pinned (pagetype);');
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the blocks system
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_blocks_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -41,11 +41,14 @@ class block_glossary_random extends block_base {
|
||||
$this->instance_config_commit();
|
||||
}
|
||||
|
||||
$limitfrom = 0;
|
||||
$limitnum = 1;
|
||||
|
||||
switch ($this->config->type) {
|
||||
|
||||
case BGR_RANDOMLY:
|
||||
$i = rand(1,$numberofentries);
|
||||
$LIMIT = sql_paging_limit($i-1, 1);
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
@@ -58,13 +61,13 @@ class block_glossary_random extends block_base {
|
||||
if ($i > $numberofentries) { // Loop back to beginning
|
||||
$i = 1;
|
||||
}
|
||||
$LIMIT = sql_paging_limit($i-1, 1);
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
default: // BGR_LASTMODIFIED
|
||||
$i = $numberofentries;
|
||||
$LIMIT = 'LIMIT 1'; // The last one
|
||||
$limitfrom = 0;
|
||||
$SORT = 'DESC';
|
||||
break;
|
||||
}
|
||||
@@ -73,7 +76,7 @@ class block_glossary_random extends block_base {
|
||||
' FROM '.$CFG->prefix.'glossary_entries'.
|
||||
' WHERE glossaryid = '.$this->config->glossary.
|
||||
' AND approved = 1 '.
|
||||
'ORDER BY timemodified '.$SORT.' '.$LIMIT)) {
|
||||
'ORDER BY timemodified '.$SORT, $limitfrom, $limitnum)) {
|
||||
|
||||
$entry = reset($entry);
|
||||
|
||||
@@ -82,7 +85,10 @@ class block_glossary_random extends block_base {
|
||||
} else {
|
||||
$text = "<h2>".format_string($entry->concept,true)."</h2>";
|
||||
}
|
||||
$text .= format_text($entry->definition, $entry->format);
|
||||
|
||||
$options = new object;
|
||||
$options->trusttext = true;
|
||||
$text .= format_text($entry->definition, $entry->format, $options);
|
||||
|
||||
$this->config->nexttime = usergetmidnight(time()) + DAYSECS * $this->config->refresh;
|
||||
$this->config->previous = $i;
|
||||
@@ -169,7 +175,6 @@ class block_glossary_random extends block_base {
|
||||
// place link to glossary in the footer if the glossary is visible
|
||||
$glossaryid = $this->config->glossary;
|
||||
$glossary=get_record('glossary', 'id', $glossaryid);
|
||||
$studentcanpost = $glossary->studentcanpost; //needed to decide on which footer
|
||||
|
||||
//Create a temp valid module structure (course,id)
|
||||
$tempmod->course = $this->course->id;
|
||||
@@ -178,7 +183,7 @@ class block_glossary_random extends block_base {
|
||||
//Obtain the visible property from the instance
|
||||
if (instance_is_visible('glossary', $tempmod)) {
|
||||
$cm = get_coursemodule_from_instance('glossary',$glossaryid, $this->course->id) ;
|
||||
if ($studentcanpost) {
|
||||
if (has_capability('mod/glossary:write', get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
$this->content->footer = '<a href="'.$CFG->wwwroot.'/mod/glossary/edit.php?id='.$cm->id
|
||||
.'" title="'.$this->config->addentry.'">'.$this->config->addentry.'</a><br />';
|
||||
} else {
|
||||
|
||||
@@ -52,7 +52,7 @@ class block_login extends block_base {
|
||||
$this->content->text .= '<table align="center" cellpadding="2" cellspacing="0" class="logintable">';
|
||||
|
||||
$this->content->text .= '<tr><td class="c0 r0" align="right">'.get_string('username').':</td>';
|
||||
$this->content->text .= '<td class="c1 r0"><input type="text" name="username" size="10" value="'.$username.'" /></td></tr>';
|
||||
$this->content->text .= '<td class="c1 r0"><input type="text" name="username" size="10" value="'.s($username).'" /></td></tr>';
|
||||
|
||||
$this->content->text .= '<tr><td class="c0 r1" align="right">'.get_string('password').':</td>';
|
||||
$this->content->text .= '<td class="c1 r1"><input type="password" name="password" size="10" value="" /></td></tr>';
|
||||
|
||||
@@ -245,11 +245,6 @@ class block_base {
|
||||
// The full treatment, please. Include the title text.
|
||||
print_side_block($this->_title_html(), $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes(), $this->title);
|
||||
}
|
||||
|
||||
//make a record of the block for the ajax course format to use
|
||||
if (!empty($COURSE->javascriptportal)) {
|
||||
$COURSE->javascriptportal->block_add('inst'.$this->instance->id,!$this->instance->visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,13 +303,7 @@ class block_base {
|
||||
|
||||
switch ($this->instance->pagetype) {
|
||||
case 'course-view':
|
||||
if ($this->instance->pageid == SITEID) {
|
||||
$context = get_context_instance(CONTEXT_SYSTEM, $this->instance->pageid);
|
||||
} else {
|
||||
$context = get_context_instance(CONTEXT_COURSE, $this->instance->pageid);
|
||||
}
|
||||
|
||||
if (!has_capability('moodle/site:manageblocks', $context)) {
|
||||
if (!has_capability('moodle/site:manageblocks', $blockcontext)) {
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
@@ -358,7 +347,7 @@ class block_base {
|
||||
|
||||
// place holder for roles button
|
||||
$movebuttons .= '<a class="icon roles" title="'. $this->str->assignroles .'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$blockcontext->id.'">' .
|
||||
'<img src="'.$CFG->pixpath.'/i/roles.gif" alt="'.$this->str->assignroles.'" /></a>';
|
||||
'<img src="'.$CFG->pixpath.'/i/roles.gif" alt="'.$this->str->assignroles.'" height="11" width="11" border="0"/></a>';
|
||||
|
||||
$movebuttons .= '<a class="icon hide" title="'. $title .'" href="'.$script.'&blockaction=toggle">' .
|
||||
'<img src="'. $CFG->pixpath.$icon .'" alt="'.$title.'" /></a>';
|
||||
@@ -706,14 +695,9 @@ class block_list extends block_base {
|
||||
print_side_block($this->_title_html(), '', $this->content->items, $this->content->icons,
|
||||
$this->content->footer, $this->html_attributes(), $this->title);
|
||||
}
|
||||
|
||||
//make a record of the block for the ajax course format to use
|
||||
if (!empty($COURSE->javascriptportal)) {
|
||||
$COURSE->javascriptportal->block_add('inst'.$this->instance->id,!$this->instance->visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function news_items_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function news_items_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the news_items block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_news_items_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -72,9 +72,9 @@ class block_online_users extends block_base {
|
||||
ul.userid = u.id
|
||||
$courseselect
|
||||
$timeselect
|
||||
$groupselect ".sql_paging_limit(0,20);
|
||||
$groupselect ";
|
||||
|
||||
if ($pusers = get_records_sql($SQL)) {
|
||||
if ($pusers = get_records_sql($SQL, 0, 20)) {
|
||||
foreach ($pusers as $puser) {
|
||||
$puser->fullname = fullname($puser);
|
||||
$users[$puser->id] = $puser;
|
||||
@@ -95,9 +95,16 @@ class block_online_users extends block_base {
|
||||
foreach ($users as $user) {
|
||||
$this->content->text .= '<li class="listentry">';
|
||||
$timeago = format_time(time() - max($user->timeaccess, $user->lastaccess)); //bruno to calculate correctly on frontpage
|
||||
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true).' ';
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$COURSE->id.'" title="'.$timeago.'">'.$user->fullname.'</a>';
|
||||
if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and !isguest()) { // Only when logged in
|
||||
if ($user->username == 'guest') {
|
||||
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true, false).' ';
|
||||
$this->content->text .= get_string('guestuser');
|
||||
|
||||
} else {
|
||||
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true).' ';
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$COURSE->id.'" title="'.$timeago.'">'.$user->fullname.'</a>';
|
||||
}
|
||||
if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and
|
||||
!isguest() and $user->username != 'guest') { // Only when logged in and messaging active etc
|
||||
$this->content->text .= "\n".' <a title="'.get_string('messageselectadd').'" target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);">'
|
||||
.'<img class="messageicon" src="'.$CFG->pixpath.'/t/message.gif" alt="'. get_string('messageselectadd') .'" /></a>';
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function online_users_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function online_users_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the online_users block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_online_users_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function participants_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function participants_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the participants block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_participants_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to MySQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function recent_activity_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
// THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
|
||||
//
|
||||
// This file keeps track of upgrades to Moodle's
|
||||
// blocks system.
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// Versions are defined by backup_version.php
|
||||
// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
|
||||
// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
|
||||
//
|
||||
// This file is tailored to PostgreSQL
|
||||
|
||||
@@ -28,6 +17,8 @@ function recent_activity_upgrade($oldversion=0) {
|
||||
$result = true; //Nothing to do
|
||||
}
|
||||
|
||||
////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
|
||||
|
||||
//Finally, return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php //$Id$
|
||||
|
||||
// This file keeps track of upgrades to
|
||||
// the recent_activity block
|
||||
//
|
||||
// Sometimes, changes between versions involve
|
||||
// alterations to database structures and other
|
||||
// major things that may break installations.
|
||||
//
|
||||
// The upgrade function in this file will attempt
|
||||
// to perform all the necessary actions to upgrade
|
||||
// your older installtion to the current version.
|
||||
//
|
||||
// If there's something it cannot do itself, it
|
||||
// will tell you what you need to do.
|
||||
//
|
||||
// The commands in here will all be database-neutral,
|
||||
// using the functions defined in lib/ddllib.php
|
||||
|
||||
function xmldb_block_recent_activity_upgrade($oldversion=0) {
|
||||
|
||||
global $CFG, $THEME, $db;
|
||||
|
||||
$result = true;
|
||||
|
||||
/// And upgrade begins here. For each one, you'll need one
|
||||
/// block of code similar to the next one. Please, delete
|
||||
/// this comment lines once this file start handling proper
|
||||
/// upgrade code.
|
||||
|
||||
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
|
||||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -102,7 +102,8 @@
|
||||
'sesskey' => $USER->sesskey,
|
||||
'blockaction' => 'config',
|
||||
'currentaction' => 'managefeeds',
|
||||
'id' => $this->courseid
|
||||
'id' => $this->courseid,
|
||||
'section' => 'rss'
|
||||
));
|
||||
$output .= '<div align="center"><a title="'. get_string('feedsaddedit', 'block_rss_client') .'" href="'. $script .'">'. get_string('feedsaddedit', 'block_rss_client') .'</a></div>';
|
||||
} else {
|
||||
@@ -113,7 +114,8 @@
|
||||
'sesskey' => $USER->sesskey,
|
||||
'blockaction' => 'config',
|
||||
'currentaction' => 'configblock',
|
||||
'id' => $this->courseid
|
||||
'id' => $this->courseid,
|
||||
'section' => 'rss'
|
||||
));
|
||||
$output .= '<div align="center"><a title="'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'" href="'. $script.'">'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'</a></div>';
|
||||
}
|
||||
@@ -128,7 +130,7 @@
|
||||
$numids = count($rssidarray);
|
||||
$count = 0;
|
||||
foreach ($rssidarray as $rssid) {
|
||||
$output .= $this->get_rss_by_id($rssid, $display_description, $shownumentries, ($numids > 1) ? true : false);
|
||||
$output .= clean_text($this->get_rss_by_id($rssid, $display_description, $shownumentries, ($numids > 1) ? true : false), FORMAT_HTML);
|
||||
if ($numids > 1 && $count != $numids -1 && !empty($rssfeedstring)) {
|
||||
$output .= '<hr width="80%" />';
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ $tabs = $row = array();
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
|
||||
if (has_capability('moodle/site:manageblocks', $context)) {
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id));
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id, 'section' => 'rss'));
|
||||
$row[] = new tabobject('configblock', $script,
|
||||
get_string('configblock', 'block_rss_client'));
|
||||
}
|
||||
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id));
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'managefeeds', 'id' => $id, 'section' => 'rss'));
|
||||
$row[] = new tabobject('managefeeds', $script,
|
||||
get_string('managefeeds', 'block_rss_client'));
|
||||
|
||||
|
||||
@@ -38,11 +38,8 @@ $block_rss_client_capabilities = array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_PREVENT,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
@@ -52,11 +49,7 @@ $block_rss_client_capabilities = array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_PREVENT,
|
||||
'teacher' => CAP_PREVENT,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
@@ -66,11 +59,8 @@ $block_rss_client_capabilities = array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_PREVENT,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
@@ -80,15 +70,10 @@ $block_rss_client_capabilities = array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_PREVENT,
|
||||
'student' => CAP_PREVENT,
|
||||
'teacher' => CAP_PREVENT,
|
||||
'editingteacher' => CAP_PREVENT,
|
||||
'coursecreator' => CAP_PREVENT,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user