Guest User

Untitled

a guest
Oct 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. var conn;
  2. function checkAuth(){
  3. Ext.Ajax.request({
  4. url: '<?php echo Zend_Registry::get('config1')->site->url; ?>admin/index/checkauth',
  5. success: function(response){
  6. auth = Ext.util.JSON.decode(unescape(response.responseText)).success;
  7.  
  8. if(auth) return;
  9. else document.location.href= "<?php echo Zend_Registry::get('config1')->site->url; ?>";
  10. }
  11. });
  12. }
  13.  
  14. Ext.onReady(function(){
  15.  
  16. var appMask;
  17. appMask = new Ext.LoadMask(Ext.getBody(), {msg:'Loading...'});
  18. appMask.show();
  19.  
  20. conn = new Ext.data.Connection();
  21. conn.addListener('beforerequest', function(con){
  22. //Ext.util.JSON.decode(unescape(response)).success;
  23. checkAuth();
  24. });
Add Comment
Please, Sign In to add comment