Skip to content

Commit

Permalink
Merge branch 'dev-4'
Browse files Browse the repository at this point in the history
  • Loading branch information
gondoh committed Jan 27, 2022
2 parents eb44ee4 + 5455845 commit 5745546
Show file tree
Hide file tree
Showing 37 changed files with 628 additions and 179 deletions.
13 changes: 5 additions & 8 deletions app/webroot/theme/admin-third/Elements/admin/content_fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @var array $parentContents
* @var bool $related 親サイトに連携する設定で、エイリアス、もしくはフォルダであるかどうか
* 上記に一致する場合、URLに関わるコンテンツ名は編集できない
* @var bool $disableEditContent コンテンツ編集不可かどうか
* @var bool $editable コンテンツ編集不可かどうか
*/

$fullUrl = $previewUrl = '';
Expand Down Expand Up @@ -71,10 +71,7 @@
}
}
$linkedFullUrl = $this->BcContents->getCurrentFolderLinkedUrl() . $contentsName;
$disableEdit = false;
if ($this->BcContents->isEditable()) {
$disableEdit = true;
}
$editable = $this->BcContents->isEditable();
?>


Expand Down Expand Up @@ -143,7 +140,7 @@ class="bca-icon--globe"></i><?php echo urldecode($fullUrl) ?></a>
data-bca-label-type="required"><?php echo __d('baser', '必須') ?></span>
</th>
<td class="col-input bca-form-table__input">
<?php if (!$disableEdit): ?>
<?php if ($editable): ?>
<?php echo $this->BcForm->input('Content.title', ['type' => 'text', 'size' => 50]) ?> 
<?php echo $this->BcForm->error('Content.title') ?>
<?php else: ?>
Expand All @@ -157,7 +154,7 @@ class="bca-icon--globe"></i><?php echo urldecode($fullUrl) ?></a>
&nbsp;<span class="bca-label" data-bca-label-type="required"><?php echo __d('baser', '必須') ?></span>
</th>
<td class="col-input bca-form-table__input">
<?php if (!$disableEdit): ?>
<?php if ($editable): ?>
<?php echo $this->BcForm->input('Content.self_status', ['type' => 'radio', 'options' => [0 => __d('baser', '公開しない'), 1 => __d('baser', '公開する')]]) ?>
<?php else: ?>
<?php echo $this->BcText->arrayValue($this->BcForm->value('Content.self_status'), [0 => __d('baser', '公開しない'), 1 => __d('baser', '公開する')]) ?>
Expand All @@ -173,7 +170,7 @@ class="bca-icon--globe"></i><?php echo urldecode($fullUrl) ?></a>
<tr>
<th class="col-head bca-form-table__label"><?php echo $this->BcForm->label('Content.self_status', __d('baser', '公開日時')) ?></th>
<td class="col-input bca-form-table__input">
<?php if (!$disableEdit): ?>
<?php if ($editable): ?>
<?php echo $this->BcForm->input('Content.self_publish_begin', [
'type' => 'dateTimePicker',
'size' => 12,
Expand Down
15 changes: 6 additions & 9 deletions app/webroot/theme/admin-third/Elements/admin/content_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@

/**
* コンテンツオプション
* @var bool $disableEditContent コンテンツ編集不可かどうか
* @var bool $editable コンテンツ編集不可かどうか
* @var array $authors 作成者リスト
* @var array $layoutTemplates レイアウトテンプレートリスト
*/
$disableEdit = false;
if ($this->BcContents->isEditable()) {
$disableEdit = true;
}
$editable = $this->BcContents->isEditable();
?>


Expand All @@ -34,7 +31,7 @@ class="bca-icon--chevron-down bca-collapse__btn-icon"></i></button>
<tr>
<th class="col-head bca-form-table__label"><?php echo $this->BcForm->label('Content.description', __d('baser', '説明文')) ?></th>
<td class="col-input bca-form-table__input">
<?php if (!$disableEdit): ?>
<?php if ($editable): ?>
<?php echo $this->BcForm->input('Content.description', ['type' => 'textarea', 'cols' => 36, 'rows' => 4, 'data-input-text-size' => 'full-counter']) ?>
<?php else: ?>
<?php if ($this->BcForm->value('Content.exclude_search')): ?>
Expand All @@ -50,7 +47,7 @@ class="bca-icon--chevron-down bca-collapse__btn-icon"></i></button>
<tr>
<th class="col-head bca-form-table__label"><?php echo $this->BcForm->label('Content.eyecatch', __d('baser', 'アイキャッチ')) ?></th>
<td class="col-input bca-form-table__input">
<?php if (!$disableEdit): ?>
<?php if ($editable): ?>
<?php echo $this->BcForm->input('Content.eyecatch', ['type' => 'file', 'imgsize' => 'thumb']) ?>
<?php else: ?>
<?php echo $this->BcUpload->uploadImage('Content.eyecatch', $this->BcForm->value('Content.eyecatch'), ['imgsize' => 'thumb']) ?>
Expand All @@ -61,7 +58,7 @@ class="bca-icon--chevron-down bca-collapse__btn-icon"></i></button>
<tr>
<th class="col-head bca-form-table__label"><?php echo $this->BcForm->label('Content.author_id', __d('baser', '作成者')) ?></th>
<td class="col-input bca-form-table__input">
<?php if (!$disableEdit): ?>
<?php if ($editable): ?>
<?php echo $this->BcForm->input('Content.author_id', ['type' => 'select', 'options' => $authors]) ?> 
<small>[<?php echo __d('baser', '作成日') ?>
]</small> <?php echo $this->BcForm->input('Content.created_date', ['type' => 'dateTimePicker', 'size' => 12, 'maxlength' => 10]) ?> 
Expand Down Expand Up @@ -94,7 +91,7 @@ class="bca-icon--chevron-down bca-collapse__btn-icon"></i></button>
<tr>
<th class="col-head bca-form-table__label"><?php echo $this->BcForm->label('Content.exclude_search', __d('baser', 'その他設定')) ?></th>
<td class="col-input bca-form-table__input">
<?php if (!$disableEdit): ?>
<?php if ($editable): ?>
<span
style="white-space: nowrap"><?php echo $this->BcForm->input('Content.exclude_search', ['type' => 'checkbox', 'label' => __d('baser', 'サイト内検索の検索結果より除外する')]) ?></span> 
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
<br>
<?php echo $data['Site']['alias'] ?>
</td>
<td class="bca-table-listup__tbody-td" style="width:5%;" class="bc-align-center status">
<td class="bca-table-listup__tbody-td bc-align-center status" style="width:5%;">
<?php echo $this->BcText->booleanMark($data['Site']['status']); ?><br>
</td>
<td class="bca-table-listup__tbody-td" class="bc-align-center">
<td class="bca-table-listup__tbody-td">
<?php echo $this->BcText->arrayValue($data['Site']['device'], $devices, ''); ?><br>
<?php echo $this->BcText->arrayValue($data['Site']['lang'], $langs, ''); ?>
</td>
Expand Down
7 changes: 3 additions & 4 deletions app/webroot/theme/admin-third/MailContents/admin/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@ class="bca-form-table__label -label"><?php echo $this->BcForm->label('MailConten
</td>
</tr>
<tr>
<th class="col-head bca-form-table__label"><?php echo $this->BcForm->label('MailContent.sender_name', __d('baser', '送信先名')) ?>
&nbsp;<span class="bca-label" data-bca-label-type="required"><?php echo __d('baser', '必須') ?></span>
<th class="col-head bca-form-table__label"><?php echo $this->BcForm->label('MailContent.sender_name', __d('baser', '送信先名')) ?></span>
</th>
<td class="col-input bca-form-table__input">
<?php echo $this->BcForm->input('MailContent.sender_name', ['type' => 'text', 'size' => 80, 'maxlength' => 255]) ?>
<?php echo $this->BcForm->input('MailContent.sender_name', ['type' => 'text', 'size' => 80, 'maxlength' => 255, 'placeholder' => '送信先名を入力してください。']) ?>
<i class="bca-icon--question-circle btn help bca-help"></i>
<?php echo $this->BcForm->error('MailContent.sender_name') ?>
<div id="helptextSenderName" class="helptext"><?php echo __d('baser', '自動返信メールの送信者に表示します。') ?></div>
<div id="helptextSenderName" class="helptext"><?php echo __d('baser', '自動返信メールの送信者に表示します。入力がない場合、サイト名が設定されます。') ?></div>
</td>
</tr>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions app/webroot/theme/admin-third/Users/admin/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ function openCredit(completeHandler) {
</div>
<div class="bca-login-forgot-pass">
<?php if ($currentPrefix == 'front'): ?>
<?php $this->BcBaser->link(__d('baser', 'パスワードを忘れた場合はこちら'), ['action' => 'reset_password']) ?>
<?php $this->BcBaser->link(__d('baser', 'パスワードを忘れた場合はこちら'), ['action' => 'send_activate_url']) ?>
<?php else: ?>
<?php $this->BcBaser->link(__d('baser', 'パスワードを忘れた場合はこちら'), ['action' => 'reset_password', $this->request->params['prefix'] => true]) ?>
<?php $this->BcBaser->link(__d('baser', 'パスワードを忘れた場合はこちら'), ['action' => 'send_activate_url', $this->request->params['prefix'] => true]) ?>
<?php endif ?>
</div>
</div>
Expand Down
36 changes: 20 additions & 16 deletions app/webroot/theme/admin-third/Users/admin/reset_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,29 @@
*/

/**
* [ADMIN] パスワードリセット画面
* [ADMIN] パスワード再生成画面
*/
$userModel = Configure::read('BcAuthPrefix.' . $currentPrefix . '.userModel');
if (!$userModel) {
$userModel = 'User';
}
?>


<div class="section">
<p><?php echo __d('baser', 'パスワードを忘れた方は、登録されているメールアドレスを送信してください。<br />新しいパスワードをメールでお知らせします。') ?></p>
<?php if ($currentPrefix == 'front'): ?>
<?php echo $this->BcForm->create($userModel, ['url' => ['action' => 'reset_password']]) ?>
<?php else: ?>
<?php echo $this->BcForm->create($userModel, ['url' => ['action' => 'reset_password', $this->request->params['prefix'] => true]]) ?>
<?php endif ?>
<div class="submit">
<?php echo $this->BcForm->input($userModel . '.email', ['type' => 'text', 'size' => 34]) ?>
<?php echo $this->BcForm->submit(__d('baser', '送信'), ['div' => false, 'class' => 'btn-red button bca-btn', 'data-bca-btn-status' => 'warning']) ?>
</div>
<?php echo $this->BcForm->end() ?>
<h2>新しいパスワードを発行しました。</h2>
<p>
新しいパスワード : <?= $this->get('new_password') ?>
</p>
<p>
任意のパスワードを設定したい場合は
<?php
$this->BcBaser->link(
__d('baser', 'アカウント設定'),
[
SessionHelper::read('Auth.Admin.id'),
'admin' => true,
'plugin' => null,
'controller' => 'users',
'action' => 'edit'
]
);
?>で変更してください。
</p>
</div>
42 changes: 42 additions & 0 deletions app/webroot/theme/admin-third/Users/admin/send_activate_url.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* baserCMS : Based Website Development Project <https://basercms.net>
* Copyright (c) baserCMS Users Community <https://basercms.net/community/>
*
* @copyright Copyright (c) baserCMS Users Community
* @link https://basercms.net baserCMS Project
* @package Baser.View
* @since baserCMS v 0.1.0
* @license https://basercms.net/license/index.html
*/

/**
* [ADMIN] パスワードリセット画面
*/
$userModel = Configure::read('BcAuthPrefix.' . $currentPrefix . '.userModel');
if (!$userModel) {
$userModel = 'User';
}
$form_attr = ['action' => 'send_activate_url'];
if ($currentPrefix !== 'front') {
$form_attr[$this->request->params['prefix']] = true;
}
?>
<div class="section">
<p>
<?= __d('baser', 'パスワードを忘れた方は、登録されているメールアドレスを送信してください。')?>
<?= __d('baser', 'パスワードの再設定手順をメールでお知らせします。')?>
</p>
<?= $this->BcForm->create($userModel, ['url' => $form_attr]) ?>
<div class="submit">
<?= $this->BcForm->input(
$userModel . '.email',
['type' => 'text', 'size' => 34])
?>
<?= $this->BcForm->submit(
__d('baser', '送信'),
['div' => false, 'class' => 'btn-red button bca-btn', 'data-bca-btn-status' => 'warning'])
?>
</div>
<?= $this->BcForm->end() ?>
</div>
22 changes: 22 additions & 0 deletions app/webroot/theme/admin-third/Users/admin/sent_activate_url.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* baserCMS : Based Website Development Project <https://basercms.net>
* Copyright (c) baserCMS Users Community <https://basercms.net/community/>
*
* @copyright Copyright (c) baserCMS Users Community
* @link https://basercms.net baserCMS Project
* @package Baser.View
* @since baserCMS v 0.1.0
* @license https://basercms.net/license/index.html
*/

/**
* [ADMIN] パスワードリセット画面
*/
?>
<div class="section">
<p>
パスワードの再設定手順をメールで送信しました。メールの内容を確認し、パスワードを再発行してください。<br>
この画面は閉じてもかまいません。
</p>
</div>
16 changes: 16 additions & 0 deletions app/webroot/theme/admin-third/Users/send_activate_url.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* baserCMS : Based Website Development Project <https://basercms.net>
* Copyright (c) baserCMS Users Community <https://basercms.net/community/>
*
* @copyright Copyright (c) baserCMS Users Community
* @link https://basercms.net baserCMS Project
* @package Baser.View
* @since baserCMS v 3.0.7
* @license https://basercms.net/license/index.html
*/

/**
* [ADMIN] アクティベート要求画面
*/
include BASER_VIEWS . 'Users' . DS . 'admin' . DS . 'send_activate_url.php';
2 changes: 2 additions & 0 deletions lib/Baser/Config/Schema/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function after($event = []) {
'email' => ['type' => 'string', 'null' => true, 'default' => null],
'user_group_id' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 4],
'nickname' => ['type' => 'string', 'null' => true, 'default' => null],
'activate_key' => ['type' => 'string', 'null' => true, 'default' => null],
'activate_expire' => ['type' => 'datetime', 'null' => true, 'default' => null],
'created' => ['type' => 'datetime', 'null' => true, 'default' => null],
'modified' => ['type' => 'datetime', 'null' => true, 'default' => null],
'indexes' => ['PRIMARY' => ['column' => 'id', 'unique' => 1]],
Expand Down
3 changes: 2 additions & 1 deletion lib/Baser/Config/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@
* セキュリティ設定
*/
$config['BcSecurity'] = [
'csrfExpires' => '+4 hours'
'csrfExpires' => '+4 hours',
'passwordChangeExpire' => '+1 hours'
];

/**
Expand Down
36 changes: 36 additions & 0 deletions lib/Baser/Config/update/4.5.5/alter_users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/* Users schema generated on: 2021-04-02 21:00:00 : 1617364800 */

class UsersSchema extends CakeSchema {

public $name = 'Users';

public $file = 'users.php';

public $connection = 'default';

public function before($event = []) {
return true;
}

public function after($event = []) {
}

public $users = [
'id' => ['type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'],
'name' => ['type' => 'string', 'null' => true, 'default' => null],
'password' => ['type' => 'string', 'null' => true, 'default' => null],
'real_name_1' => ['type' => 'string', 'null' => true, 'default' => null, 'length' => 50],
'real_name_2' => ['type' => 'string', 'null' => true, 'default' => null, 'length' => 50],
'email' => ['type' => 'string', 'null' => true, 'default' => null],
'user_group_id' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 4],
'nickname' => ['type' => 'string', 'null' => true, 'default' => null],
'activate_key' => ['type' => 'string', 'null' => true, 'default' => null],
'activate_expire' => ['type' => 'datetime', 'null' => true, 'default' => null],
'created' => ['type' => 'datetime', 'null' => true, 'default' => null],
'modified' => ['type' => 'datetime', 'null' => true, 'default' => null],
'indexes' => ['PRIMARY' => ['column' => 'id', 'unique' => 1]],
'tableParameters' => ['charset' => 'utf8', 'collate' => 'utf8_general_ci']
];
}
24 changes: 24 additions & 0 deletions lib/Baser/Config/update/4.5.5/updater.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* baserCMS : Based Website Development Project <http://basercms.net>
* Copyright (c) baserCMS Users Community <http://basercms.net/community/>
*
* @copyright Copyright (c) baserCMS Users Community
* @link https://basercms.net baserCMS Project
* @package Baser.Config
* @since baserCMS v 4.4.6
* @license https://basercms.net/license/index.html
*/

/**
* 4.4.6 バージョン アップデートスクリプト
*/

/**
* search_indices テーブル構造変更
*/
if($this->loadSchema('4.5.5', '', 'users', 'alter')) {
$this->setUpdateLog('users テーブルの構造変更に成功しました。');
} else {
$this->setUpdateLog('users テーブルの構造変更に失敗しました。', true);
}
2 changes: 1 addition & 1 deletion lib/Baser/Controller/BcAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ public function sendMail($to, $title = '', $body = '', $options = [])
if (!empty($this->siteConfigs['email'])) {
$from = $this->siteConfigs['email'];
if (strpos($from, ',') !== false) {
$from = explode(',', $from);
$from = strstr($from, ',', true);
}
} else {
$from = $toAddress;
Expand Down
6 changes: 0 additions & 6 deletions lib/Baser/Controller/Component/BcContentsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,18 +316,12 @@ public function settingForm(Controller $controller, $currentSiteId, $currentCont
$data['Site']['relate_main_site'] && $data['Content']['main_site_content_id'] && $data['Content']['type'] == 'ContentFolder') {
$related = true;
}
$disableEditContent = false;
$controller->request->data = $data;
if (!BcUtil::isAdminUser() || ($controller->request->data['Site']['relate_main_site'] && $controller->request->data['Content']['main_site_content_id'] &&
($controller->request->data['Content']['alias_id'] || $controller->request->data['Content']['type'] == 'ContentFolder'))) {
$disableEditContent = true;
}
$currentSiteId = $siteId = $controller->request->data['Site']['id'];
if (is_null($currentSiteId)) {
$currentSiteId = 0;
}
$controller->set('currentSiteId', $currentSiteId);
$controller->set('disableEditContent', $disableEditContent);
$controller->set('related', $related);
}

Expand Down
Loading

0 comments on commit 5745546

Please sign in to comment.