'recursive' => 1,
'contain' => array(
'User',
+ 'FromUser',
),
'limit' => 20,
'order' => array(
- 'SendMails.modified' => 'asc'
+ 'SendMail.modified' => 'desc'
),
);
if (!empty($this->data)) {
$postdata = $this->data;
+ $this->data['SendMail']['user_id'] = 1;
+
+ if (!empty($this->user_id)) {
+ $this->data['SendMail']['from_user_id'] = $this->user_id;
+ }
+
+ $this->data['SendMail']['useragent'] = $_SERVER["HTTP_USER_AGENT"];
+ $this->data['SendMail']['host'] = gethostbyaddr($_SERVER["REMOTE_ADDR"]);
+
$this->SendMail->set($this->data);
if ($this->SendMail->validates()) {
$from = $this->data['SendMail']['from'];
$this->data['SendMail']['from'] = $this->Crypt->crypt($this->data['SendMail']['from']);
- $this->data['SendMail']['subject'] = $this->data['SendMail']['subject']. sprintf(__('[%s %s] ', true), $this->site_configs['Site.siteName']['value'], __('Contact', true));
+ $this->data['SendMail']['subject'] = sprintf(__('[%s %s] ', true), $this->site_configs['Site.siteName']['value'], __('Contact', true)). $this->data['SendMail']['subject'];
$this->SendMail->create();
if ($this->SendMail->save($this->data, array('fieldList' => $this->SendMail->fields['add'], 'validate' => false))) {
function admin_index() {
$this->SendMail->recursive = 0;
- $this->set('sendMails', $this->paginate());
- }
- function admin_view($id = null) {
- if (!$id) {
- $this->Session->setFlash(__('Invalid send mail', true));
- $this->redirect(array('action' => 'index'));
+
+ $send_mails = $this->paginate();
+ foreach ($send_mails as $k => $v) {
+ $send_mails[$k] = $this->_restore_html_sendmail($v);
}
- $this->set('sendMail', $this->SendMail->read(null, $id));
+
+ $this->set('sendMails', $send_mails);
}
+
function admin_delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for send mail', true));
return true;
}
+
+ function _restore_html_sendmail($data, $nl2br = false) {
+ if (isset($data['SendMail']['from']) && !empty($data['SendMail']['from'])) {
+ $data['SendMail']['from'] = $this->Crypt->decrypt($data['SendMail']['from']);
+ }
+
+ if (isset($data['User']['pcmail']) && !empty($data['User']['pcmail'])) {
+ $data['User']['pcmail'] = $this->Crypt->decrypt($data['User']['pcmail']);
+ }
+ if (isset($data['FromUser']['pcmail']) && !empty($data['FromUser']['pcmail'])) {
+ $data['FromUser']['pcmail'] = $this->Crypt->decrypt($data['FromUser']['pcmail']);
+ }
+
+ $data['SendMail']['body'] = $this->{$this->modelClass}->restore_html($data['SendMail']['body'], false, false, false);
+ if ($nl2br) {
+ $data['SendMail']['body'] = str_replace('<br />', "\n", $data['SendMail']['body']);
+ }
+
+ return $data;
+ }
}
msgid "Add New System"
msgstr "システム作成"
-#: /views/elements/admin_user_sidenav.ctp:2
-msgid "List of Users"
-msgstr "ユーザ一覧"
+msgid "Mail Registing List"
+msgstr "メール登録中一覧"
+
+msgid "Mail Sended List"
+msgstr "メール送信一覧"
#: /views/elements/admin_user_sidenav.ctp:3
msgid "Add New User"
msgstr "ユーザ作成"
-#: /views/elements/admin_user_sidenav.ctp:3
-msgid "List of Mail Registing"
-msgstr "メール登録中一覧"
-
#: /views/elements/character_picture_index.ctp:9
msgid "%s's Pictures"
msgstr "%sの画像一覧"
msgid "Please input your password, if you want to delete your account."
msgstr "本当に削除するならば、確認のためにパスワードを入力して下さい。"
-#: /views/users/listview.ctp:2
-msgid "List Users"
-msgstr "ユーザ一覧"
-
#: /views/users/login.ctp:
msgid "Registration"
msgstr "ユーザ登録"
msgid "Rewrite"
msgstr "修正"
+
+msgid "No Logged-in"
+msgstr "ログインなし"
+
+msgid "Send Mails"
+msgstr "送信済みメール"
+
+msgid "From"
+msgstr "送信者"
+
+msgid "From Address"
+msgstr "送信者アドレス"
+
+msgid "Receive"
+msgstr "受信者"
var $name = 'SendMail';
var $fields = array(
- 'add' => array('from', 'subject', 'body'),
+ 'add' => array('user_id', 'from', 'from_user_id', 'subject', 'body', 'useragent', 'host'),
'escape' => array(
'subject' => array(
'html' => true,
'body' => array(
'html' => true,
'tags' => true,
- 'all' => true,
+ 'images' => true,
+ 'sctipts' => true,
),
),
);
'className' => 'User',
'foreignKey' => 'from_user_id',
'fields' => array(
- 'User.id',
- 'User.name',
- 'User.pcmail'
+ 'FromUser.id',
+ 'FromUser.name',
+ 'FromUser.pcmail'
),
),
);
<div class="actions">
<ul>
<li><?php echo $html->link(__('New CharacterPicture', true), array('action' => 'add')); ?></li>
- <li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
+ <li><?php echo $html->link(__('Users List', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Characters', true), array('controller' => 'characters', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Character', true), array('controller' => 'characters', 'action' => 'add')); ?> </li>
<?php endif; ?>
<?php __('List of All CharacterSheets');?>
</h2>
-</h2></div>
+</span></div>
<div class="boxBody">
<p>
<?php
<ul>
-<li><?php echo $html->link(__('List of Users', true), array('controller' => 'users', 'action' => 'listview', 'prefix' => Configure::read('Routing.prefixes'))); ?></li>
+<li><?php echo $html->link(__('Users List', true), array('controller' => 'users', 'action' => 'listview', 'prefix' => Configure::read('Routing.prefixes'))); ?></li>
<li><?php echo $html->link(__('Add New User', true), array('controller' => 'users', 'action' => 'add', 'prefix' => Configure::read('Routing.prefixes'))); ?></li>
-<li><?php echo $html->link(__('List of Mail Registing', true), array('controller' => 'regist_mails', 'prefix' => Configure::read('Routing.prefixes'))); ?></li>
+<li><?php echo $html->link(__('Mail Sended List', true), array('controller' => 'send_mails', 'prefix' => Configure::read('Routing.prefixes'))); ?></li>
+<li><?php echo $html->link(__('Mail Registing List', true), array('controller' => 'regist_mails', 'prefix' => Configure::read('Routing.prefixes'))); ?></li>
</ul>
<ul>
- <li><?php echo $html->link(__('List of Users', true), array('controller' => 'users', 'action' => 'listview')); ?> </li>
+ <li><?php echo $html->link(__('Users List', true), array('controller' => 'users', 'action' => 'listview')); ?> </li>
<li><?php echo $html->link(__('Edit User', true), array('controller' => 'users', 'action' => 'edit')); ?> </li>
<li><?php echo $html->link(__('Edit Image', true), array('controller' => 'users', 'action' => 'edit_image')); ?> </li>
<li><?php echo $html->link(__('Regist Mail', true), array('controller' => 'regist_mails', 'action' => 'add')); ?> </li>
switch ($this->params["controller"]) {
case 'users':
case 'regist_mails':
+ case 'send_mails':
echo $this->element('sidenav_admin_user', array());
break;
case 'systems':
}
break;
case 'regist_mails':
+ case 'send_mails':
if ($user['User']['id']) {
echo $this->element('sidenav_config', array());
}
<fieldset>
<legend><?php __('Contact Mail'); ?></legend>
<?php
+ $usermail = null;
+ if (isset($user['User']['pcmail'])) {
+ $usermail = $user['User']['pcmail'];
+ }
echo $form->input('from', array(
'type' => 'text',
'label' => __('Your Address', true),
- 'value' => $user['User']['pcmail'],
+ 'value' => $usermail,
'class' => 'longInput',
));
echo $form->input('subject', array(
}
td.lastAccess,
-td.modified,
-td.userAgent {
+td.modified {
white-space: normal;
}
-td.userAgent {
- width: 200px;
-}
div.siteConfigs
{
.boxBody div.publicFlag {
width: auto;
}
-/* 立ち絵 */
+/* 背景画像 */
.fullLength {
height:100%;
min-height:100%;
/* ユーザ一覧 */
#Users_admin_search table th,
-#Users_admin_listview table th {
+#Users_admin_listview table th,
+#SendMails_admin_index table th {
white-space: nowrap;
}
.users .characterList {
top: -4px;
left: 5px;
}
+div.UserAgent,
+div.Host {
+ font-size: 80%;
+ text-align: right;
+ color: #999;
+}
+
/* 履歴一覧 */
dl#ArchiveList {