public function LoadAcc($id)
 {
     $acc = new Account();
     $allaccs = file('storage/account.txt');
     foreach ($allaccs as $allacc) {
         $accarr = explode(':', $allacc);
         if ($id == $accarr['0']) {
             $acc->setId($accarr['0']);
             $acc->setUsername($accarr['1']);
             $acc->setPassword($accarr['2']);
             $pro = new ProfilController();
             $acc->setProfil($pro->GetById($accarr['3']));
             $lan = new SpracheController();
             $acc->setSprache($lan->GetById($accarr['4']));
             return $acc;
         }
     }
     return false;
 }
Exemple #2
0
if (empty($controller)) {
    $cont = new IndexController();
    $cont->accueilAction();
} else {
    if (strcmp($controller, "index") == 0) {
        $cont = new IndexController();
        if (empty($action)) {
            $cont->accueilAction();
        } else {
            if (strcmp($action, "telechargement") == 0) {
                $cont->telechargementAction();
            }
        }
    } else {
        if (strcmp($controller, "profil") == 0) {
            $cont = new ProfilController();
            if (empty($action)) {
                $cont->indexAction();
            }
        } else {
            if (strcmp($controller, "forum") == 0) {
                $cont = new ForumController();
                if (empty($action)) {
                    $cont->indexAction();
                }
            } else {
                if (strcmp($controller, "cours") == 0) {
                    $cont = new CoursController();
                    if (empty($action)) {
                        $cont->indexAction();
                    }