Skip to content

Commit

Permalink
Merge pull request 'Release/1.0.1' from develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LinneyS committed Nov 15, 2024
2 parents c87ae8f + a428a68 commit 61b1eb0
Show file tree
Hide file tree
Showing 44 changed files with 351 additions and 121 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

services:
postgres:
pgsql:
image: postgres:13
env:
POSTGRES_USER: 'postgres'
Expand Down Expand Up @@ -84,7 +84,12 @@ jobs:
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
- name: Install moodle-plugin-ci
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
run: |
if nc -z mariadb 3306; then
moodle-plugin-ci install --plugin ./plugin --db-host=${{ matrix.database }}
else
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
fi
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
Expand Down Expand Up @@ -137,4 +142,4 @@ jobs:

- name: Mark cancelled jobs as failed.
if: ${{ cancelled() }}
run: exit 1
run: exit 1
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Change Log

## 1.0.1
## Changed
- fixes according to markets code checks

## 1.0.0
## Added
- ONLYOFFICE DocSpace activity room element creation
- ONLYOFFICE DocSpace configuration
- Allow to invite moodle users to ONLYOFFICE DocSpace
- View ONLYOFFICE DocSpace rooms
- View ONLYOFFICE DocSpace rooms
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Moodle admins can install the plugin following the usual Moodle plugin installat

## Plugin configuration

### If you are new to ONLYOFFICE DocSpace

You can register a free account on the official website: [onlyoffice.com/docspace-registration.aspx](https://www.onlyoffice.com/docspace-registration.aspx).

The STARTUP plan of ONLYOFFICE DocSpace is absolutely free to use. If you want to check other tariff plans, visit [this page](https://www.onlyoffice.com/docspace-prices.aspx).

### General settings

At first, go to your ONLYOFFICE DocSpace ([sign up](https://www.onlyoffice.com/docspace-registration.aspx) / [sign in](https://www.onlyoffice.com/docspace-signin.aspx)) -> Developer Tools -> JavaScript SDK. Add the address of your Moodle in the section *Enter the address of DocSpace to embed*.
Expand Down
8 changes: 4 additions & 4 deletions api/inviteusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
use mod_onlyofficedocspace\local\errors\docspace_error;
use mod_onlyofficedocspace\local\errors\validation_error;
use mod_onlyofficedocspace\local\http\requests\invite_users_request;

use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\errors\validation_error;
use mod_onlyofficedocspace\http\requests\invite_users_request;
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');

defined('AJAX_SCRIPT') || define('AJAX_SCRIPT', true);

Expand Down
10 changes: 5 additions & 5 deletions api/updateadminsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

use mod_onlyofficedocspace\common\flash_message;
use mod_onlyofficedocspace\local\common\flash_message;
use mod_onlyofficedocspace\local\errors\docspace_error;
use mod_onlyofficedocspace\local\errors\validation_error;
use mod_onlyofficedocspace\local\http\requests\update_admin_settings_request;

/**
* Return json-encoded response.
*
Expand All @@ -25,10 +29,6 @@

require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');

use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\errors\validation_error;
use mod_onlyofficedocspace\http\requests\update_admin_settings_request;

defined('AJAX_SCRIPT') || define('AJAX_SCRIPT', true);

require_admin();
Expand Down
8 changes: 4 additions & 4 deletions api/updateuserpassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
use mod_onlyofficedocspace\local\errors\docspace_error;
use mod_onlyofficedocspace\local\errors\validation_error;
use mod_onlyofficedocspace\local\http\requests\update_password_request;

use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\errors\validation_error;
use mod_onlyofficedocspace\http\requests\update_password_request;
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');

defined('AJAX_SCRIPT') || define('AJAX_SCRIPT', true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\common;
namespace mod_onlyofficedocspace\local\common;

/**
* flash_message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\common;
namespace mod_onlyofficedocspace\local\common;

/**
* http request class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\common;
namespace mod_onlyofficedocspace\local\common;

/**
* http response class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\docspace;
namespace mod_onlyofficedocspace\local\docspace;

use mod_onlyofficedocspace\common\http_request;
use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\errors\invalid_credentials_error;
use mod_onlyofficedocspace\local\common\http_request;
use mod_onlyofficedocspace\local\errors\docspace_error;
use mod_onlyofficedocspace\local\errors\invalid_credentials_error;

/**
* Docspace auth manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\docspace;
namespace mod_onlyofficedocspace\local\docspace;

use mod_onlyofficedocspace\common\http_request;
use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\local\common\http_request;
use mod_onlyofficedocspace\local\errors\docspace_error;

/**
* DocSpace file manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\docspace;
namespace mod_onlyofficedocspace\local\docspace;

use mod_onlyofficedocspace\common\http_request;
use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\local\common\http_request;
use mod_onlyofficedocspace\local\errors\docspace_error;

/**
* Docspace settings class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\docspace;
namespace mod_onlyofficedocspace\local\docspace;

use mod_onlyofficedocspace\common\http_request;
use mod_onlyofficedocspace\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\local\common\http_request;
use mod_onlyofficedocspace\local\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\local\errors\docspace_error;

/**
* Docspace user manager class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\docspace;
namespace mod_onlyofficedocspace\local\docspace;

/**
* DocSpace users collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\docspace\enums;
namespace mod_onlyofficedocspace\local\docspace\enums;
// phpcs:disable
enum docspace_user_status: int {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\docspace\enums;
namespace mod_onlyofficedocspace\local\docspace\enums;
// phpcs:disable
enum docspace_user_type: int {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\errors;
namespace mod_onlyofficedocspace\local\errors;
use Exception;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\errors;
namespace mod_onlyofficedocspace\local\errors;

/**
* invalid_credentials_error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\errors;
namespace mod_onlyofficedocspace\local\errors;
use Exception;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\http\requests;
namespace mod_onlyofficedocspace\local\http\requests;

use mod_onlyofficedocspace\docspace\enums\docspace_user_status;
use mod_onlyofficedocspace\moodle\moodle_docspace_user_manager;
use mod_onlyofficedocspace\moodle\moodle_user_manager;
use mod_onlyofficedocspace\docspace\docspace_settings;
use mod_onlyofficedocspace\docspace\docspace_user_manager;
use mod_onlyofficedocspace\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\local\docspace\docspace_settings;
use mod_onlyofficedocspace\local\docspace\docspace_user_manager;
use mod_onlyofficedocspace\local\docspace\enums\docspace_user_status;
use mod_onlyofficedocspace\local\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\local\moodle\moodle_docspace_user_manager;
use mod_onlyofficedocspace\local\moodle\moodle_user_manager;

/**
* get_users_request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\http\requests;

use mod_onlyofficedocspace\common\flash_message;
use mod_onlyofficedocspace\moodle\moodle_docspace_user_manager;
use mod_onlyofficedocspace\moodle\moodle_user_manager;
use mod_onlyofficedocspace\docspace\docspace_settings;
use mod_onlyofficedocspace\docspace\docspace_user_manager;
use mod_onlyofficedocspace\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\errors\validation_error;
namespace mod_onlyofficedocspace\local\http\requests;

use mod_onlyofficedocspace\local\common\flash_message;
use mod_onlyofficedocspace\local\docspace\docspace_settings;
use mod_onlyofficedocspace\local\docspace\docspace_user_manager;
use mod_onlyofficedocspace\local\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\local\errors\docspace_error;
use mod_onlyofficedocspace\local\errors\validation_error;
use mod_onlyofficedocspace\local\moodle\moodle_docspace_user_manager;
use mod_onlyofficedocspace\local\moodle\moodle_user_manager;

/**
* invite_users_request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace mod_onlyofficedocspace\http\requests;

use Exception;
use mod_onlyofficedocspace\common\flash_message;
use mod_onlyofficedocspace\docspace\docspace_settings;
use mod_onlyofficedocspace\docspace\docspace_user_manager;
use mod_onlyofficedocspace\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\errors\docspace_error;
use mod_onlyofficedocspace\errors\invalid_credentials_error;
use mod_onlyofficedocspace\errors\validation_error;
use mod_onlyofficedocspace\moodle\moodle_docspace_user_manager;
namespace mod_onlyofficedocspace\local\http\requests;

use mod_onlyofficedocspace\local\common\flash_message;
use mod_onlyofficedocspace\local\docspace\docspace_settings;
use mod_onlyofficedocspace\local\docspace\docspace_user_manager;
use mod_onlyofficedocspace\local\docspace\enums\docspace_user_type;
use mod_onlyofficedocspace\local\errors\docspace_error;
use mod_onlyofficedocspace\local\errors\invalid_credentials_error;
use mod_onlyofficedocspace\local\errors\validation_error;
use mod_onlyofficedocspace\local\moodle\moodle_docspace_user_manager;
use moodle_exception;

/**
* update_admin_settings_request
Expand Down Expand Up @@ -62,20 +62,15 @@ class update_admin_settings_request {
* @return void
*/
public function __construct() {
if (
! (isset($_POST['url']) && !empty($_POST['url'])
&& isset($_POST['email']) && !empty($_POST['email'])
&& isset($_POST['password']) && !empty($_POST['password'])
&& isset($_POST['randomPassword']) && !empty($_POST['randomPassword']))
) {
try {
$this->docspaceurl = required_param('url', PARAM_URL);
$this->docspaceemail = required_param('email', PARAM_EMAIL);
$this->docspacepassword = required_param('password', PARAM_RAW);
$this->randompassword = required_param('randomPassword', PARAM_RAW);
} catch (moodle_exception) {
throw new validation_error(get_string('paramsmissingvalidationerror', 'onlyofficedocspace'));
}

$this->docspaceurl = $_POST['url'];
$this->docspaceemail = $_POST['email'];
$this->docspacepassword = $_POST['password'];
$this->randompassword = $_POST['randomPassword'];

$this->sanitize();
}

Expand Down
Loading

0 comments on commit 61b1eb0

Please sign in to comment.