Skip to content

Commit

Permalink
こみっと
Browse files Browse the repository at this point in the history
  • Loading branch information
amashigeseiji committed Mar 31, 2013
1 parent 0a3226c commit a8ddc1f
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 73 deletions.
4 changes: 2 additions & 2 deletions template/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
</tr>

<tr>
<td class="title">name</td>
<td class="title">ログインネーム<br />(半角英数字)</td>
<td><input type="text" name="newname"></td>
</tr>

<tr>
<td class="title">password</td>
<td class="title">パスワード<br />(半角英数字)</td>
<td><input type="password" name="newpassword"></td>
</tr>

Expand Down
98 changes: 47 additions & 51 deletions template/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,43 +89,6 @@ body{
}
/* content}}} */

td{
font-style:normal;
background-color: #ddd;
padding:5px 15px;
margin:0px;
border-radius: 8px;
}
th{
font-style:normal;
background-color: #aaa;
padding:5px;
margin:0px;
border-radius: 8px;
}

table.objects{
margin:15px;
width:90%;
}
th.title{
font-family:"Kozuka Gothic Pr6N EL";
width:50px;
}
td.delete{
text-align:center;
}
td.date{
text-align:right;
width:120px;
font-size:12px;
}
td.posted_by{
text-align:right;
width:120px;
font-size:12px;
}

/* write{{{ */
#write{
margin:0px 10px;
Expand All @@ -138,14 +101,6 @@ td.posted_by{
}
/* write}}} */

td.error{
color: #a55;
padding: 0px;
text-align:center;
background-color:#fff;

}

/* objectpage{{{ */
#objectpage{
border-radius:8px;
Expand Down Expand Up @@ -174,7 +129,6 @@ td.error{
}
/* objectpage}}} */


/* auth{{{ */
#auth{
margin-left:50px;
Expand All @@ -198,6 +152,7 @@ td.error{
font-style:normal;
}
/* auth}}} */

/* entry{{{ */
#entry{
margin:0px;
Expand All @@ -216,33 +171,74 @@ td.error{
}
/* entry}}} */


/* newentry{{{ */
#newentry{
margin-left:50px;
}
#newentry table.auth{
border-radius: none;
border-radius: 0px;
border-collapse:collapse;
background-color:#888;
}
#newentry tr{
border-radius: none;
border-radius: 0px;
border:1px #888 solid;
}
#newentry td{
border-radius: none;
border-radius: 3px;
border:1px #979a9f solid;
}
#newentry td.title{
border-radius: none;
background-color:#888;
text-align:center;
font-size:13px;
font-style:normal;
}
/* newentry}}} */

td{
font-style:normal;
background-color: #ddd;
padding:5px 15px;
margin:0px;
border-radius: 8px;
}
th{
font-style:normal;
background-color: #aaa;
padding:5px;
margin:0px;
border-radius: 8px;
}

table.objects{
margin:15px;
width:90%;
}
th.title{
font-family:"Kozuka Gothic Pr6N EL";
width:50px;
}
td.delete{
text-align:center;
}
td.date{
text-align:right;
width:120px;
font-size:12px;
}
td.posted_by{
text-align:right;
width:120px;
font-size:12px;
}
td.error{
color: #a55;
padding: 0px;
text-align:center;
background-color:#fff;
}

.back{
margin:0px;
padding:0px;
Expand Down
49 changes: 29 additions & 20 deletions user.action.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,7 @@ public function initialize()

if ( $this->isWebRequest('newname',$_POST) && $this->isWebRequest('newpassword',$_POST) )
{
if ( null == ($newname = $this->getPostValue('newname')) )
{
$this->message['register'] = 'ユーザー名は必須項目です.';
}
elseif ( null == ($newpassword = $this->getPostValue('newpassword')) )
{
$this->message['register'] = 'パスワードは必須項目です.';
}
else
{
if ( false == $this->getBaseUserObj()->registerUser($newname,$newpassword) )
{
$this->message['register'] = 'ユーザー名が重複しています.';
}
else
{
$this->message['register'] = '新規ユーザーを登録しました.';
header("Location: /");
}
}
$this->entry();
}

$this->login($this->cookie);
Expand Down Expand Up @@ -112,6 +93,34 @@ public function logout($cookie)
$action = null;
}

public function entry()
{
if ( null == ($newname = $this->getPostValue('newname')) )
{
$this->message['register'] = 'ユーザー名は必須項目です.';
return false;
}
elseif ( null == ($newpassword = $this->getPostValue('newpassword')) )
{
$this->message['register'] = 'パスワードは必須項目です.';
return false;
}
else
{
if ( false == $this->getBaseUserObj()->registerUser($newname,$newpassword) )
{
$this->message['register'] = 'ユーザー名が重複しています.';
return false;
}
else
{
$this->message['register'] = '新規ユーザーを登録しました.';
header("Location: /");
return true;
}
}
}

public function getBaseUserObj()
{
return new BaseUser;
Expand Down

0 comments on commit a8ddc1f

Please sign in to comment.