Example #1
0
 public function run()
 {
     $db = new SimpleDB();
     $list = $db->sql("SELECT * FROM ban_ip")->fetchAllAssoc();
     foreach ($list as $ip) {
         if ($_SERVER['REMOTE_ADDR'] == $ip['ip']) {
             throw new \Exception("Currently your IP is blocked by admin");
         }
     }
     CSRF::getInstance()->generate();
     Auth::doAuth();
     $this->_frontController = FrontController::getInstance();
     if ($this->router instanceof \SSFrame\Routers\iRouter) {
         $this->_frontController->setRouter($this->router);
     } else {
         $this->_frontController->setRouter(new Route());
     }
     $this->_frontController->parseRouter();
     CSRF::getInstance()->check();
 }
Example #2
0
            var button = $(event.relatedTarget);
            var id = button.data('id');

            var modal = $(this);
            modal.find('#delete_button').attr('href', '<?php 
    echo asset('/product/delete');
    ?>
/' + id);
        });

        $(function() {
            $( "#sortable" ).sortable({
                update: function (event, ui) {
                    var data = $(this).sortable('serialize');
                    data+="&csrf_token=<?php 
    echo \SSFrame\CSRF::getInstance()->token();
    ?>
";

                    $.ajax({
                        data: data,
                        type: 'POST',
                        url: '<?php 
    echo asset("/products/sort");
    ?>
'
                    });
                }
            });
        });
    </script>