Plugin Directory

Changeset 2385265


Ignore:
Timestamp:
09/20/2020 06:15:13 PM (5 years ago)
Author:
upstreamplugin
Message:

1.37.5

Location:
upstream/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • upstream/trunk/includes.php

    r2379862 r2385265  
    11<?php
    2 define('UPSTREAM_VERSION', '1.37.4');
     2define('UPSTREAM_VERSION', '1.37.5');
    33
    44global $upstream_addon_requirements;
  • upstream/trunk/includes/admin/assets/js/edit-project.js

    r2354305 r2385265  
    433433        $row.find('[data-avatar_assigned]').attr('data-avatar_assigned', '');
    434434        $row.find('[data-avatar_created_by]').attr('data-avatar_created_by', '');
     435        $row.find('.up-autoincrement').html('---');
    435436        $row.find('.up-o-tab').removeClass('nav-tab-active');
    436437        $row.find('.dashicons-flag').removeAttr('style');
  • upstream/trunk/includes/frontend/class-up-login.php

    r2077924 r2385265  
    9090
    9191        if (empty($postData['username'])) {
    92             $this->feedbackMessage = __("Email address field cannot be empty.", 'upstream');
    93         } elseif (strlen($postData['username']) < 3 || ! is_email($postData['username'])) {
    94             $this->feedbackMessage = __("Invalid email address and/or password.", 'upstream');
     92            $this->feedbackMessage = __("Email address/username field cannot be empty.", 'upstream');
     93        } elseif (strlen($postData['username']) < 3) {
     94            $this->feedbackMessage = __("Invalid email address/username.", 'upstream');
    9595        } else {
    9696            if (empty($postData['password'])) {
    9797                $this->feedbackMessage = __("Password field cannot be empty.", 'upstream');
    98             } elseif (strlen($postData['password']) < 5) {
     98            } elseif (strlen($postData['password']) < 2) {
    9999                $this->feedbackMessage = __("Invalid email address and/or password.", 'upstream');
    100100            } else {
     
    106106    }
    107107
     108    private function upstream_get_project_roles()
     109    {
     110        $options = (array)get_option('upstream_general');
     111
     112        if ( ! isset($options['project_user_roles']) || empty($options['project_user_roles'])) {
     113            $roles = [
     114                'upstream_manager',
     115                'upstream_user',
     116                'administrator',
     117            ];
     118        } else {
     119            $roles = (array)$options['project_user_roles'];
     120        }
     121
     122        $roles = apply_filters('upstream_user_roles_for_projects', $roles);
     123
     124        return $roles;
     125    }
     126
     127
    108128    /**
    109129     * Attempt to authenticate a user against the open project given current email address and password.
     
    123143            }
    124144
    125             // Check if there's a user using that email.
     145
    126146            $user = get_user_by('email', $data['username']);
    127147            if (empty($user)) {
    128                 throw new \Exception(__("Invalid email address and/or password.", 'upstream'));
     148                $user = get_user_by('login', $data['username']);
     149                if (empty($user)) {
     150                    throw new \Exception(__("Invalid user/email address and/or password.", 'upstream'));
     151                }
    129152            }
    130153
    131154            $userRoles    = (array)$user->roles;
    132             $projectRoles = array_merge(['administrator',], upstream_get_project_roles());
    133 
    134             // Check if this user has a valid UpStream Role to log in.
     155            $projectRoles = array_merge(['administrator','upstream_client_user','upstream_user','upstream_manager'], $this->upstream_get_project_roles());
     156
    135157            if (count(array_intersect(
    136158                    $userRoles,
  • upstream/trunk/includes/model/UpStream_Model_Bug.php

    r2354305 r2385265  
    104104            $r = [];
    105105            $reminder->storeToArray($r);
    106             $item_metadata['reminders'][] = $r;
     106            $item_metadata['reminders'][] = json_encode($r);
    107107        }
    108108
  • upstream/trunk/includes/model/UpStream_Model_File.php

    r2354305 r2385265  
    8787            $r = [];
    8888            $reminder->storeToArray($r);
    89             $item_metadata['reminders'][] = $r;
     89            $item_metadata['reminders'][] = json_encode($r);
    9090        }
     91
    9192    }
    9293
  • upstream/trunk/includes/model/UpStream_Model_Manager.php

    r2315471 r2385265  
    1212
    1313    protected $objects = [];
     14
     15    public function reset()
     16    {
     17        $this->objects = [];
     18    }
    1419
    1520    public function getByID($object_type, $object_id, $parent_type = null, $parent_id = 0)
  • upstream/trunk/includes/model/UpStream_Model_Meta_Object.php

    r2216956 r2385265  
    3333        $this->description = !empty($item_metadata['description']) ? $item_metadata['description'] : null;
    3434
    35         $this->additionaFields = apply_filters('upstream_model_load_fields', $this->additionaFields, $item_metadata,
     35        $this->additionalFields = apply_filters('upstream_model_load_fields', $this->additionalFields, $item_metadata,
    3636            $this->type, $this->id);
    3737    }
     
    5555
    5656        $dataToStore = [];
    57         $dataToStore = apply_filters('upstream_model_store_fields', $dataToStore, $this->additionaFields,
     57        $dataToStore = apply_filters('upstream_model_store_fields', $dataToStore, $this->additionalFields,
    5858            $this->type, $this->id);
    5959
  • upstream/trunk/includes/model/UpStream_Model_Object.php

    r2315471 r2385265  
    3333    protected $description = null;
    3434
    35     protected $additionaFields = [];
     35    protected $additionalFields = [];
    3636
    3737    /**
     
    9292            default:
    9393
    94                 if (array_key_exists($property, $this->additionaFields)) {
    95 
    96                     $value = apply_filters('upstream_model_get_property_value', $this->additionaFields[$property], $this->type, $this->id, $property);
     94                if (array_key_exists($property, $this->additionalFields)) {
     95
     96                    $value = apply_filters('upstream_model_get_property_value', $this->additionalFields[$property], $this->type, $this->id, $property);
    9797
    9898                } else {
     
    103103                    }
    104104
    105                     $this->additionaFields[$property] = null;
     105                    $this->additionalFields[$property] = null;
    106106
    107107                    return null;
     
    167167
    168168            default:
    169                 $orig_value = (array_key_exists($property, $this->additionaFields)) ? $this->additionaFields[$property] : null;
     169                $orig_value = (array_key_exists($property, $this->additionalFields)) ? $this->additionalFields[$property] : null;
    170170
    171171                $propertyExists = apply_filters('upstream_model_property_exists', false, $this->type, $this->id, $property);
     
    175175
    176176                $new_value = apply_filters('upstream_model_set_property_value', $orig_value, $this->type, $this->id, $property, $value);
    177                 $this->additionaFields[$property] = $new_value;
     177                $this->additionalFields[$property] = $new_value;
    178178        }
    179179    }
  • upstream/trunk/includes/model/UpStream_Model_Post_Object.php

    r2216956 r2385265  
    7878        }
    7979
    80         $this->additionaFields = apply_filters('upstream_model_load_fields', $this->additionaFields, $dataToLoad,
     80        $this->additionalFields = apply_filters('upstream_model_load_fields', $this->additionalFields, $dataToLoad,
    8181            $this->type, $this->id);
    8282    }
     
    117117
    118118        $dataToStore = [];
    119         $dataToStore = apply_filters('upstream_model_store_fields', $dataToStore, $this->additionaFields,
     119        $dataToStore = apply_filters('upstream_model_store_fields', $dataToStore, $this->additionalFields,
    120120            $this->type, $this->id);
    121121
  • upstream/trunk/readme.txt

    r2379862 r2385265  
    55Tested up to: 5.5
    66Requires PHP: 5.6.20
    7 Stable tag: 1.37.4
     7Stable tag: 1.37.5
    88License: GPL-3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    136136The format is based on [Keep a Changelog](http://keepachangelog.com)
    137137and this project adheres to [Semantic Versioning](http://semver.org).
     138
     139= [1.37.5] - 2020-09-20 =
     140* Fixed bug in login
     141* Fixed bug for files and bugs saving via model
    138142
    139143= [1.37.4] - 2020-09-11 =
  • upstream/trunk/upstream.php

    r2379862 r2385265  
    55 * Author: UpStream
    66 * Author URI: https://upstreamplugin.com
    7  * Version: 1.37.4
     7 * Version: 1.37.5
    88 * Text Domain: upstream
    99 * Domain Path: /languages
Note: See TracChangeset for help on using the changeset viewer.