Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #25

Closed
dehlirious opened this issue Feb 15, 2024 · 4 comments
Closed

Fixes #25

dehlirious opened this issue Feb 15, 2024 · 4 comments

Comments

@dehlirious
Copy link

dehlirious commented Feb 15, 2024

Add include_once 'init.php'; after include_once 'config/config.php'; in session.php otherwise

Undefined variable $allowed_pages
PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given

6fdc402

EDIT: Seems there's an issue
$allowed_pages doesn't have activate.php added to it, resulting in new users not being able to activate their accounts.

Adding activate.php to allowed_pages fixes the issue.

I'm assuming reset.php + forgot-password.php + expire.php also needs to be added to the same list otherwise unauthenticated users would not be able to reset their passwords

EDIT: After testing it out, I can't reset my password regardless as it endlessly states Your token has expired. Please try again.

Update:
The issue is
return $this->isExpired($token) ? false : true;
in isExist, 'Return true if the token exists otherwise false' - yet if the token is Not expired, it returns false, and if it is expired it returns true.

To refine this further, the issue is actually
function isExpired - Return true if the token expired otherwise false yet it returns false if the token is expired otherwise it returns true, swap around the true/false's in isExpired to fix it and the issue is resolved

also,

forgot-password.php can be accessed even if you're signed in

Also add maintenance.php to allowed_pages , otherwise unauthenticated users get redirected to login.php which sends to maintenance.php which gets sent to login.php, so on and so forth

Slight bug: when maintanence mode is enabled, and then I get signed out, I cannot sign in to disable maintanence mode

Another bug: Warning: Undefined array key "delete_files_success" in profile/my_files.php on line 23
Another: if you input a invalid file_id on edit.php, many warnings instead of a proper handling of the issue(Attempt to read property "file_data" on false) whereas delete.php handles improper file_id correctly

Another bug: Max filesize is set to 256mb regardless of settings , its done via Dropzone,
in upload.js set maxFilesize: 1024, // in MB -- not sure exactly how I'd go about changing it to the Role's max, but i suppose since that's done server side it is unnecessary, just set a 5gb limit and if the user role doesn't allow it, it'll be rejected

Also a way to have this functional would be ideal
chunking: true, chunkSize: 10000 * 1024,
Because otherwise this error will occur with big files: 413 Request Entity Too Large (cloudflare limits to 100mb)
But I tried it, and it does Not work! Instead, it ends up with multiple files being uploaded

@dehlirious
Copy link
Author

dehlirious commented Feb 16, 2024

Fix for a bug:

    <?php $utils->script(
        'https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"'
    ); ?>

to

    <?php $utils->script(
        'https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js'
    ); ?>

in admin/index.php

Then,
In admin/components/js.php
Add this before 'js/scripts.js' to remove the javascript error $(...).tagsinput is not a function

$utils->script("https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.min.js");

Be warned: this changes settings/view.php , the keywords portion, completely changes the styling, for some reason. I'm not sure as to why
Changes tag badge badge-primary to tag label label-info

@farisc0de
Copy link
Owner

Fix for a bug:

    <?php $utils->script(
        'https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"'
    ); ?>

to

    <?php $utils->script(
        'https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js'
    ); ?>

in admin/index.php

Then, In admin/components/js.php Add this before 'js/scripts.js' to remove the javascript error $(...).tagsinput is not a function

$utils->script("https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.min.js");

Be warned: this changes settings/view.php , the keywords portion, completely changes the styling, for some reason. I'm not sure as to why Changes tag badge badge-primary to tag label label-info

  1. Fixed
  2. It is already there

@farisc0de
Copy link
Owner

Add include_once 'init.php'; after include_once 'config/config.php'; in session.php otherwise

Undefined variable $allowed_pages
PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given

6fdc402

EDIT: Seems there's an issue $allowed_pages doesn't have activate.php added to it, resulting in new users not being able to activate their accounts.

Adding activate.php to allowed_pages fixes the issue.

I'm assuming reset.php + forgot-password.php + expire.php also needs to be added to the same list otherwise unauthenticated users would not be able to reset their passwords

EDIT: After testing it out, I can't reset my password regardless as it endlessly states Your token has expired. Please try again.

Update: The issue is return $this->isExpired($token) ? false : true; in isExist, 'Return true if the token exists otherwise false' - yet if the token is Not expired, it returns false, and if it is expired it returns true.

To refine this further, the issue is actually function isExpired - Return true if the token expired otherwise false yet it returns false if the token is expired otherwise it returns true, swap around the true/false's in isExpired to fix it and the issue is resolved

also,

forgot-password.php can be accessed even if you're signed in

Also add maintenance.php to allowed_pages , otherwise unauthenticated users get redirected to login.php which sends to maintenance.php which gets sent to login.php, so on and so forth

Slight bug: when maintanence mode is enabled, and then I get signed out, I cannot sign in to disable maintanence mode

Another bug: Warning: Undefined array key "delete_files_success" in profile/my_files.php on line 23 Another: if you input a invalid file_id on edit.php, many warnings instead of a proper handling of the issue(Attempt to read property "file_data" on false) whereas delete.php handles improper file_id correctly

Another bug: Max filesize is set to 256mb regardless of settings , its done via Dropzone, in upload.js set maxFilesize: 1024, // in MB -- not sure exactly how I'd go about changing it to the Role's max, but i suppose since that's done server side it is unnecessary, just set a 5gb limit and if the user role doesn't allow it, it'll be rejected

Also a way to have this functional would be ideal chunking: true, chunkSize: 10000 * 1024, Because otherwise this error will occur with big files: 413 Request Entity Too Large (cloudflare limits to 100mb) But I tried it, and it does Not work! Instead, it ends up with multiple files being uploaded

Fixed

@farisc0de
Copy link
Owner

Fix for a bug:

    <?php $utils->script(
        'https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"'
    ); ?>

to

    <?php $utils->script(
        'https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js'
    ); ?>

in admin/index.php

Then, In admin/components/js.php Add this before 'js/scripts.js' to remove the javascript error $(...).tagsinput is not a function

$utils->script("https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.min.js");

Be warned: this changes settings/view.php , the keywords portion, completely changes the styling, for some reason. I'm not sure as to why Changes tag badge badge-primary to tag label label-info

For the tagsinput issue it is fixed now, why it changed becuase the version I have locally on the code is customized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants