コード例 #1
0
ファイル: NoticesController.php プロジェクト: tlandn/dmca-app
 /**
  *  Store a new DMCA notice.
  *
  * @param Request $request
  *
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function store(Request $request)
 {
     \Debugbar::debug($request->request);
     // debug($request);
     $notice = $this->createNotice($request);
     Mail::queue(['text' => 'emails.dmca'], compact('notice'), function ($message) use($notice) {
         $message->from($notice->getOwnerEmail())->to($notice->getRecipientEmail())->subject('DMCA Notice');
     });
     flash('Your DMCA notice has been delivered!');
     return redirect('notices');
 }
コード例 #2
0
 /**
  * Obfuscate a single file's contents
  *
  * @param  string $source
  * @return string obfuscated contents
  **/
 public function obfuscateFileContents($source, $file = false)
 {
     $traverser = new PhpParser\NodeTraverser();
     if (input::get('ReplaceVariables')) {
         /**
          * all $vars
          */
         $traverser->addVisitor(new \Controllers\Obfuscator\ScrambleVariable($this));
         $traverser->addVisitor(new \Controllers\Obfuscator\ScrambleString($this));
     }
     if (input::get('ReplaceFunctions')) {
         /**
          * all OOP functions
          */
         $traverser->addVisitor(new \Controllers\Obfuscator\ScrambleFunction($this));
         /**
          * all NONE OOP functions (NATIVE)
          */
         $traverser->addVisitor(new \Controllers\Obfuscator\ScrambleNativeFunction($this));
     }
     if (input::get('ReplaceVariables')) {
         /**
          * all OOP $this->vars
          */
         $traverser->addVisitor(new \Controllers\Obfuscator\ScrambleProperty($this));
     }
     //if( input::get('ReplaceSmart') ) {
     //$traverser->addVisitor(new \Controllers\Obfuscator\ScrambleSmart($this));
     //}
     $parser = new Parser(new Lexer());
     // traverse
     $stmts = $traverser->traverse($parser->parse($source));
     $prettyPrinter = new PrettyPrinter();
     $nodeDumper = new PhpParser\NodeDumper();
     Debugbar::debug($stmts);
     // pretty print
     $code = "<?php\n" . $prettyPrinter->prettyPrint($stmts);
     if (Input::has('test')) {
         @header("Content-Type:text/plain");
         print_r($this->getFuncPack());
         print_r($this->getVarPack());
         echo '<pre>';
         echo $nodeDumper->dump($stmts), "\n";
         echo htmlentities($code);
         echo '</pre>';
     }
     return $code;
 }
コード例 #3
0
<div {{ $field->formgroup() }}>
    <label for="{{ $field->name() }}" class="control-label">
        {{ $field->label() }}
    </label>
    <div class="row">
        @foreach( $field->options() as $key => $val )
        <div class="checkbox col-md-3">
            <label>
            <?php 
Debugbar::debug($field->selected());
?>
            @if( ! is_null( $field->selected() ) &&  $key === $field->selected() )
            {{ Form::radio( $field->name() , $key , true  ) . $val }}
            @else
            {{ Form::radio( $field->name() , $key , false  ) . $val }}
            @endif
            </label>
        </div>
        @endforeach
    </div>
    <div class="text-danger">
        {{ $field->errors() }}
    </div>
</div>