Changed App.Auth to method mode.

This commit is contained in:
Martin Edenhofer 2012-07-15 17:16:18 +02:00
parent 99d1bfce00
commit bd0b29a200
5 changed files with 7 additions and 14 deletions

View file

@ -65,6 +65,5 @@ class App.SettingsAreaItem extends App.Controller
success: =>
# login check
auth = new App.Auth
auth.loginCheck()
App.Auth.loginCheck()
)

View file

@ -90,8 +90,7 @@ class Index extends App.Controller
if @master_user
@master_user = false
auth = new App.Auth
auth.login(
App.Auth.login(
data: {
username: @params.login,
password: @params.password,
@ -113,8 +112,7 @@ class Index extends App.Controller
@log 'login:success', data
# login check
auth = new App.Auth
auth.loginCheck()
App.Auth.loginCheck()
# add notify
Spine.trigger 'notify:removeall'

View file

@ -60,8 +60,7 @@ class Index extends App.Controller
@username = params['username']
# session create with login/password
auth = new App.Auth
auth.login(
App.Auth.login(
data: params,
success: @success
error: @error,

View file

@ -10,8 +10,7 @@ class Index extends Spine.Controller
signout: ->
# remove remote session
auth = new App.Auth
auth.logout()
App.Auth.logout()
# remoce local session
@log 'Session', window.Session

View file

@ -61,8 +61,7 @@ class Index extends App.Controller
# save user
user.save(
success: (r) =>
auth = new App.Auth
auth.login(
App.Auth.login(
data: {
username: @params.login,
password: @params.password,
@ -77,8 +76,7 @@ class Index extends App.Controller
success: (data, status, xhr) =>
# login check
auth = new App.Auth
auth.loginCheck()
App.Auth.loginCheck()
# add notify
Spine.trigger 'notify:removeall'