Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
Ygopro Arena Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Ygopro Arena Web
Commits
adc7bd3c
Commit
adc7bd3c
authored
May 25, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册联盟
parent
a9b0cfbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+12
-4
app/views/users/new.html.erb
app/views/users/new.html.erb
+3
-1
config/environments/production.rb
config/environments/production.rb
+1
-1
No files found.
app/controllers/users_controller.rb
View file @
adc7bd3c
...
@@ -64,11 +64,13 @@ class UsersController < ApplicationController
...
@@ -64,11 +64,13 @@ class UsersController < ApplicationController
#@user.name = params[:user][:name]
#@user.name = params[:user][:name]
#@user.password = params[:user][:password]
#@user.password = params[:user][:password]
@actions
=
[
User
.
human_attribute_name
(
:register
)]
@actions
=
[
User
.
human_attribute_name
(
:register
)]
@continue
=
params
[
:continue
]
@from
=
params
[
:from
].
to_s
.
to_sym
respond_to
do
|
format
|
respond_to
do
|
format
|
if
@user
.
save
if
@user
.
save
boardcast_user
(
@user
)
boardcast_user
(
@user
,
:"ygopro-ocg"
)
session
[
:user_id
]
=
@user
.
id
session
[
:user_id
]
=
@user
.
id
format
.
html
{
redirect_to
(
params
[
:continue
]
||
@user
,
:notice
=>
'注册成功'
)
}
format
.
html
{
redirect_to
(
params
[
:continue
]
?
URI
.
escape
(
params
[:
continue
])
:
@user
,
:notice
=>
'注册成功'
)
}
format
.
xml
{
render
:xml
=>
@user
,
:status
=>
:created
,
:location
=>
@user
}
format
.
xml
{
render
:xml
=>
@user
,
:status
=>
:created
,
:location
=>
@user
}
else
else
format
.
html
{
render
:action
=>
"new"
}
format
.
html
{
render
:action
=>
"new"
}
...
@@ -138,7 +140,7 @@ class UsersController < ApplicationController
...
@@ -138,7 +140,7 @@ class UsersController < ApplicationController
session
[
:user_id
]
=
@user
.
id
session
[
:user_id
]
=
@user
.
id
@user
.
update_attribute
(
:lastloginip
,
request
.
remote_ip
)
@user
.
update_attribute
(
:lastloginip
,
request
.
remote_ip
)
boardcast_user
(
@user
)
boardcast_user
(
@user
)
format
.
html
{
redirect_to
(
params
[
:continue
]
||
@user
,
:notice
=>
'Login Successfully.'
)
}
format
.
html
{
redirect_to
(
params
[
:continue
]
?
URI
.
escape
(
params
[:
continue
])
:
@user
,
:notice
=>
'Login Successfully.'
)
}
format
.
json
{
render
json:
@user
}
format
.
json
{
render
json:
@user
}
else
else
@user
=
User
.
new
(
params
[
:user
])
@user
=
User
.
new
(
params
[
:user
])
...
@@ -168,7 +170,7 @@ class UsersController < ApplicationController
...
@@ -168,7 +170,7 @@ class UsersController < ApplicationController
format
.
xml
{
head
:ok
}
format
.
xml
{
head
:ok
}
end
end
end
end
def
boardcast_user
(
user
)
def
boardcast_user
(
user
,
wait
=
nil
)
Server
.
find_each
do
|
server
|
Server
.
find_each
do
|
server
|
url
=
"http://
#{
server
.
ip
}
:
#{
server
.
http_port
}
/?pass=
#{
server
.
password
}
&operation=forceuserpass&username=
#{
CGI
.
escape
user
.
name
}
&password=
#{
CGI
.
escape
user
.
password
}
"
url
=
"http://
#{
server
.
ip
}
:
#{
server
.
http_port
}
/?pass=
#{
server
.
password
}
&operation=forceuserpass&username=
#{
CGI
.
escape
user
.
name
}
&password=
#{
CGI
.
escape
user
.
password
}
"
if
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
if
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
...
@@ -177,5 +179,11 @@ class UsersController < ApplicationController
...
@@ -177,5 +179,11 @@ class UsersController < ApplicationController
Process
.
spawn
(
'curl'
,
url
)
Process
.
spawn
(
'curl'
,
url
)
end
end
end
end
url
=
"http://ygopro-ocg.com/mycard.php?key=zh99998&username=
#{
CGI
.
escape
user
.
name
}
&password=
#{
CGI
.
escape
user
.
password
}
&email=
#{
CGI
.
escape
user
.
email
}
"
if
wait
==
:"ygopro-ocg"
or
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
open
(
url
){}
else
Process
.
spawn
(
'curl'
,
url
)
end
end
end
end
end
\ No newline at end of file
app/views/users/new.html.erb
View file @
adc7bd3c
...
@@ -98,11 +98,13 @@
...
@@ -98,11 +98,13 @@
<div
class=
"inner_div"
>
<div
class=
"inner_div"
>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:email
%>
</div>
<div
class=
"floatleft form_label"
>
<%=
f
.
label
:email
%>
</div>
<div
class=
"floatleft"
>
<div
class=
"floatleft"
>
<%=
f
.
text
_field
:email
,
:id
=>
:email
,
:class
=>
:from_input
%>
<%=
f
.
email
_field
:email
,
:id
=>
:email
,
:class
=>
:from_input
%>
</div>
</div>
</div>
</div>
<div
class=
"inner_div"
>
<div
class=
"inner_div"
>
<%=
f
.
submit
:class
=>
"film_bit_download"
,
:style
=>
"width:54px;height:25px;padding:4px 14px;border:1px solid #eeeeee;border-radius:5px;color:#ffffff;"
%>
<%=
f
.
submit
:class
=>
"film_bit_download"
,
:style
=>
"width:54px;height:25px;padding:4px 14px;border:1px solid #eeeeee;border-radius:5px;color:#ffffff;"
%>
</div>
</div>
<input
type=
"hidden"
name=
"continue"
id=
"continue"
value=
"
<%=
@continue
%>
"
/>
<input
type=
"hidden"
name=
"from"
value=
"
<%=
@from
%>
"
/>
</div>
</div>
<%
end
%>
<%
end
%>
config/environments/production.rb
View file @
adc7bd3c
...
@@ -5,7 +5,7 @@ MycardServerHttp::Application.configure do
...
@@ -5,7 +5,7 @@ MycardServerHttp::Application.configure do
config
.
cache_classes
=
true
config
.
cache_classes
=
true
# Full error reports are disabled and caching is turned on
# Full error reports are disabled and caching is turned on
config
.
consider_all_requests_local
=
fals
e
config
.
consider_all_requests_local
=
tru
e
config
.
action_controller
.
perform_caching
=
true
config
.
action_controller
.
perform_caching
=
true
# Disable Rails's static asset server (Apache or nginx will already do this)
# Disable Rails's static asset server (Apache or nginx will already do this)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment