コード例 #1
0
ファイル: AllTest.php プロジェクト: nyclagniappe/phpjazz
 /**
  * Suite Method
  * @return \Jazz\Test\Suite
  */
 public static function suite()
 {
     $obj = new All();
     $obj->addTestSuite('Unit\\CallbackTest');
     $obj->addTestSuite('Unit\\CollectionTest');
     $obj->addTestSuite('Unit\\LoaderTest');
     return $obj;
 }
コード例 #2
0
ファイル: AllTest.php プロジェクト: shinichi81/eep-php
 /** @test */
 public function compensateRemovesNumber()
 {
     $all = new All();
     $all->init();
     $all->accumulate(1);
     $all->accumulate(1);
     $all->accumulate(1);
     $all->accumulate(5);
     $all->compensate(5);
     $this->assertEquals(0, $all->emit()['vars']);
 }
コード例 #3
0
ファイル: OauthController.php プロジェクト: chris27tina/TODO
 public function session()
 {
     if (Request::segment(2) == 'facebook') {
         $provider = OAuth2::provider('facebook', array('id' => '494491330565385', 'secret' => '1dd38781d55ed1825724e433ef1ce6e3'));
     }
     // if(Request::segment(2) == 'twitter'){
     // 	$provider = OAuth2::provider('twitter', array(
     //     'id' => '494491330565385',
     //     'secret' => '1dd38781d55ed1825724e433ef1ce6e3',
     // 	));
     // }
     if (Request::segment(2) == 'google') {
         $provider = OAuth2::provider('google', array('id' => '406188381495-cil9u3fcb7jtu3hq2idinp3s92qvr8f6.apps.googleusercontent.com', 'secret' => 'ZOGyJqHOl5xMfGVQ-wTInqUs'));
     }
     if (Request::segment(2) == 'github') {
         $provider = OAuth2::provider('github', array('id' => '67d050b4c06ad12d95be', 'secret' => '4a03507448e3ffd9904eaa7b6fc7d3d75c373739', 'scope' => 'user:email'));
     }
     // if(Request::segment(2) == 'stackexchange'){
     // 	$provider = OAuth2::provider('stackexchange', array(
     //     'id' => '494491330565385',
     //     'secret' => '1dd38781d55ed1825724e433ef1ce6e3',
     // 	));
     // }
     if (!isset($_GET['code'])) {
         // By sending no options it'll come back here
         return $provider->authorize();
     } else {
         // Howzit?
         try {
             $params = $provider->access($_GET['code']);
             $token = new Token_Access(array('access_token' => $params->access_token));
             $data = $provider->get_user_info($token);
             // Here you should use this information to A) look for a user B) help a new user sign up with existing data.
             // If you store it all in a cookie and redirect to a registration page this is crazy-simple.
             // return $data;
             $user_id = $this->checkAndSave($data);
             if ($user_id == false) {
                 return Redirect::back()->with('error', 'Your email was not public. Please join with another provider.');
                 //return Response::json(array());
             }
         } catch (OAuth2_Exception $e) {
             show_error('That didnt work: ' . $e);
         }
     }
     // return Redirect::to('auth/signin')->with('oauth', $data);
     // return Response::json(array('success' => Lang::get('auth/message.signin.success')));
     // return Redirect::to('devs/'.$user_id);
     // return Redirect::back(); //breaks some times
     //check for any pending posts and assign then to the signed in user
     $redirect = All::completePosting();
     $redirect = !empty($redirect) ? $redirect : Session::get('loginRedirect', 'account');
     return Redirect::to($redirect);
     // so you can complete creating the post you were creating. temp solutin
 }
コード例 #4
0
ファイル: Picture.php プロジェクト: alex-bro/yiitest
 /**
  * @return mixed
  */
 protected function beforeDelete()
 {
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
     }
     $path = $_SERVER['DOCUMENT_ROOT'] . self::model()->findByPk($id)->image;
     if (is_file($path)) {
         unlink($path);
     }
     return parent::beforeDelete();
 }
コード例 #5
0
<?php

session_start();
require_once 'include/php/connect.php';
require_once 'AllClass.php';
$allObj = new All();
$pageName = "index.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="no-js">
<head>
    <meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="Harish Kandala">
    <meta name="description" content="UI FORCE is a community in maintaining the National Integrity of our country. The main motto of our organisation is Unity and Patriotism. It strives for the all round development of India and works more like a comapny which provide employment opportunities and services to the general public thereby STRENGTHENING INDIA">
    <meta name="keywords" content="United India FORCE, India, NPO, Unity, Students">
    <title>United India FORCE | Home</title>
    <link rel="icon" href="img/favicon.png">
    <!-----------------------------Stylesheets---------------------------->
    <link rel="stylesheet" type="text/css" href="include/css/styles.css">
    <!-------------------------------------------------------------------->
    <script src="include/js/init.js" type="text/javascript"></script>
</head>
<body>
<div class="loading valign-wrapper">
    <div class='valign'>
        <div class="text">Loading</div>
        <div class="bullets">
            <div class='bullet'></div>
            <div class='bullet'></div>
コード例 #6
0
ファイル: Category.php プロジェクト: alex-bro/yiitest
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
コード例 #7
0
ファイル: TestController.php プロジェクト: chris27tina/TODO
 public function getRecords()
 {
     $records = All::getAllRecords();
     return $records;
 }
コード例 #8
0
ファイル: routes-useless.php プロジェクト: chris27tina/TODO
    Route::resource('suppliers', 'SuppliersController');
});
Route::resource('profiles', 'ProfilesController');
Route::resource('products', 'ProductsController');
Route::get('list', 'ProductsController@getProductlist');
// Route::resource('users.company', 'UserCompaniesController');
Route::resource('companies', 'CompaniesController');
Route::resource('catalogues', 'CataloguesController');
Route::get('categories/{name}', 'CategoriesController@showByName');
Route::resource('categories', 'CategoriesController');
Route::resource('counties', 'CountiesController');
Route::resource('buying_leads', 'Buying_leadsController');
// Route::resource('todos', 'TodosController');
// id:increments, title:string, description:text, deadline:string, person:string, done:boolean, flag:boolean
Route::get('business', function () {
    var_dump(All::getBusiness());
});
Route::resource('names', 'NamesController');
# Partners Management
Route::group(array('prefix' => 'partners'), function () {
    Route::get('create', array('as' => 'create/partner', 'uses' => 'PartnersController@getCreate'));
    Route::post('create', 'PartnersController@postCreate');
    Route::get('{partnerId}', array('as' => 'partner.show', 'uses' => 'PartnersController@getShow'));
    Route::get('{partnerId}/edit', array('as' => 'update/partner', 'uses' => 'PartnersController@getEdit'));
    Route::post('{partnerId}/edit', 'PartnersController@postEdit');
    Route::get('{partnerId}/delete', array('as' => 'delete/partner', 'uses' => 'PartnersController@getDelete'));
    Route::get('{partnerId}/restore', array('as' => 'restore/partner', 'uses' => 'PartnersController@getRestore'));
});
# Advertisements Management
Route::group(array('prefix' => 'advertisements'), function () {
    Route::get('/', array('as' => 'advertisements', 'uses' => 'AdvertisementsController@getIndex'));
コード例 #9
0
ファイル: All.php プロジェクト: chris27tina/TODO
 public static function massUpdateSupplier($resource)
 {
     $records = Input::all();
     foreach ($records as $key => $value) {
         $value = $value == 'on' ? 1 : 0;
         $m = All::getModel($resource);
         $rec = $m::find(substr($key, 1));
         $rec->update(array('featured' => $value));
     }
     return Redirect::to('suppliers')->with('success', ucwords($resource) . ' successfully updated!');
 }
コード例 #10
0
ファイル: UsersController.php プロジェクト: chris27tina/TODO
 public function edit($id)
 {
     $user = $this->user->find($id);
     $counties = DB::table('counties')->get();
     if (All::checkEditRight($user)) {
         return All::checkEditRight($user);
     }
     if (is_null($user)) {
         return Redirect::route('users.index');
     }
     return View::make('users.edit', compact('user'));
 }