| | 114 | <mt:IfBlog> |
|---|
| | 115 | <mt:IfRegistrationAllowed> |
|---|
| | 116 | /*** |
|---|
| | 117 | * If request contains a '#_login' or '#_logout' hash, use this to |
|---|
| | 118 | * also delete the blog-side user cookie, since we're coming back from |
|---|
| | 119 | * a login, logout or edit profile operation. |
|---|
| | 120 | */ |
|---|
| | 121 | var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false; |
|---|
| | 122 | if (clearCookie) { |
|---|
| | 123 | // clear any logged in state |
|---|
| | 124 | mtClearUser(); |
|---|
| | 125 | if (RegExp.$1 == 'in') |
|---|
| | 126 | mtFetchUser(); |
|---|
| | 127 | } else { |
|---|
| | 128 | <mt:Ignore> |
|---|
| | 129 | /*** |
|---|
| | 130 | * Uncondition this call to fetch the current user state (if available) |
|---|
| | 131 | * from MT upon page load if no user cookie is already present. |
|---|
| | 132 | * This is okay if you have a private install, such as an Intranet; |
|---|
| | 133 | * not recommended for public web sites! |
|---|
| | 134 | */ |
|---|
| | 135 | </mt:Ignore> |
|---|
| | 136 | if ( is_preview && !user ) |
|---|
| | 137 | mtFetchUser(); |
|---|
| | 138 | } |
|---|
| | 139 | </mt:IfRegistrationAllowed> |
|---|
| | 140 | </mt:IfBlog> |
|---|
| | 141 | |
|---|