Skip to content

Commit

Permalink
Logout fixed, authentication now needed to access back office pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovic Landry committed Jul 17, 2011
1 parent f28f962 commit 75d08dc
Show file tree
Hide file tree
Showing 14 changed files with 223 additions and 66 deletions.
44 changes: 25 additions & 19 deletions back/application_list.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,26 +17,32 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */

use Entities\Application,
Entities\Developer,
Entities\Device,
Entities\Invitation,
Entities\Tester,
Entities\Version;

require_once __DIR__ . '/../constants.php';
require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../tools.php';

$entityManager = initDoctrine();

// Retrieve all testers
$applications = $entityManager->getRepository('Entities\Application')->findAll();

?>


<!doctype html> session_start();

use Entities\Application,
Entities\Developer,
Entities\Device,
Entities\Invitation,
Entities\Tester,
Entities\Version;

require_once __DIR__ . '/../constants.php';
require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../core/Membership.php';
require_once __DIR__ . '/../tools.php';

if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}

$entityManager = initDoctrine();

// Retrieve all testers
$applications = $entityManager->getRepository('Entities\Application')->findAll();

?><!doctype html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Expand Down
9 changes: 9 additions & 0 deletions back/application_new.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */


session_start();

require_once __DIR__ . '/../core/Membership.php';

if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}

?><!doctype html> ?><!doctype html>
<html> <html>
<head> <head>
Expand Down
52 changes: 28 additions & 24 deletions back/application_upload.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,37 +17,41 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */

use Entities\Application;
use Entities\Version;

require_once __DIR__ . '/../lib/cfpropertylist/CFPropertyList.php';
require_once __DIR__ . '/../tools.php';
require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../constants.php';
require_once __DIR__ . '/../lib/PngCompote/PngCompote.php';



function unzipApplication($upload_path, $filename) { session_start();


$zip = new ZipArchive; use Entities\Application;
$res = $zip->open($upload_path . $filename); use Entities\Version;
if ($res === TRUE) {


$appName = substr($filename, 0, -4); require_once __DIR__ . '/../lib/cfpropertylist/CFPropertyList.php';
$zip->extractTo($upload_path . $appName . '/'); require_once __DIR__ . '/../tools.php';
$zip->close(); require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../core/Membership.php';
require_once __DIR__ . '/../constants.php';
require_once __DIR__ . '/../lib/PngCompote/PngCompote.php';


return true; if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}


} else { function unzipApplication($upload_path, $filename) {
return false;
}
}


?> $zip = new ZipArchive;
$res = $zip->open($upload_path . $filename);
if ($res === TRUE) {

$appName = substr($filename, 0, -4);
$zip->extractTo($upload_path . $appName . '/');
$zip->close();

return true;
} else {
return false;
}
}


<!doctype html> ?><!doctype html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Expand Down
8 changes: 8 additions & 0 deletions back/developer_create.php
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,19 @@
<?php <?php


session_start();

use Entities\Developer; use Entities\Developer;


require_once __DIR__ . '/../core/index.php'; require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../core/functions.php'; require_once __DIR__ . '/../core/functions.php';
require_once __DIR__ . '/../core/Membership.php';
require_once __DIR__ . '/../tools.php'; require_once __DIR__ . '/../tools.php';


if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}

if (!isset($_POST['name'], $_POST['email'], $_POST['pwd']) ) { if (!isset($_POST['name'], $_POST['email'], $_POST['pwd']) ) {
die('parameters needed.'); die('parameters needed.');
} }
Expand Down
75 changes: 75 additions & 0 deletions back/developer_profile.php
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

/*
* RunThisApp allows sharing test builds of iOS apps with testers.
* Copyright (C) 2011 Ludovic Landry & Pascal Cans
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

session_start();

require_once __DIR__ . '/../core/Membership.php';

if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}

?><!doctype html>
<html lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Run This App | Developer Profile</title>
<link href="../css/style-0001.css" media="screen" type="text/css" rel="stylesheet">
</head>
<body>

<?php include __DIR__ . '/../header.php'; ?>

<div id="content" class="box">
<div class="boxtop"></div>
<div class="column first">
<div class="boxheader">
<h2>Developer Profile</h2>
</div>
<div>
<p>//TODO:</p>
</div>
</div>

<div class="column last">
<div class="boxheader">
<h2>Deployment steps</h2>
</div>
<div class="function">
<h6>Send Invitations</h6>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<hr>
<div class="function">
<h6>Tester get registered</h6>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<hr>
<div class="function">
<h6>They install your app Over-The-Air</h6>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</div>
<div class="boxbottom"></div>
</div>

</body>
</html>
8 changes: 8 additions & 0 deletions back/invitation_list.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */


session_start();

require_once __DIR__ . '/../constants.php'; require_once __DIR__ . '/../constants.php';
require_once __DIR__ . '/../core/Membership.php';

if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}


?><!doctype html> ?><!doctype html>
<html> <html>
Expand Down
11 changes: 9 additions & 2 deletions back/invitation_new.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */


session_start();

use Entities\Application, use Entities\Application,
Entities\Developer, Entities\Developer,
Entities\Device, Entities\Device,
Expand All @@ -27,11 +29,16 @@


require_once __DIR__ . '/../core/index.php'; require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../core/functions.php'; require_once __DIR__ . '/../core/functions.php';
require_once __DIR__ . '/../core/Membership.php';

if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}


$entityManager = initDoctrine(); $entityManager = initDoctrine();


?> ?><!doctype html>
<!doctype html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Expand Down
15 changes: 11 additions & 4 deletions back/invitation_send.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */


session_start();

use Entities\Application, use Entities\Application,
Entities\Developer, Entities\Developer,
Entities\Device, Entities\Device,
Expand All @@ -26,14 +28,20 @@
Entities\Version; Entities\Version;


require_once __DIR__ . '/../credentials.php'; require_once __DIR__ . '/../credentials.php';
require_once __DIR__ . '/../constants.php';
require_once __DIR__ . '/../core/index.php'; require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../mail.php'; require_once __DIR__ . '/../core/Membership.php';
require_once __DIR__ . '/../core/functions.php'; require_once __DIR__ . '/../core/functions.php';
require_once __DIR__ . '/../mail.php';
require_once __DIR__ . '/../tools.php'; require_once __DIR__ . '/../tools.php';
require_once __DIR__ . '/../lib/Swift/lib/swift_required.php'; require_once __DIR__ . '/../lib/Swift/lib/swift_required.php';


if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}

$entityManager = initDoctrine(); $entityManager = initDoctrine();
date_default_timezone_set('Europe/Paris');


//send the invits //send the invits
$nbInvitations = 0; $nbInvitations = 0;
Expand Down Expand Up @@ -120,8 +128,7 @@ function sendInvitationForDevice($device, $mailer, $url, $version, $msg, $entity


$entityManager->flush(); $entityManager->flush();


?> ?><!doctype html>
<!doctype html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Expand Down
9 changes: 9 additions & 0 deletions back/tester_create.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,17 +18,26 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */


session_start();

use Entities\Application, use Entities\Application,
Entities\Developer, Entities\Developer,
Entities\Device, Entities\Device,
Entities\Invitation, Entities\Invitation,
Entities\Tester, Entities\Tester,
Entities\Version; Entities\Version;



require_once __DIR__ . '/../core/index.php'; require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../core/functions.php'; require_once __DIR__ . '/../core/functions.php';
require_once __DIR__ . '/../core/Membership.php';
require_once __DIR__ . '/../tools.php'; require_once __DIR__ . '/../tools.php';


if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}

if (!isset($_POST['name'], $_POST['email']) ) { if (!isset($_POST['name'], $_POST['email']) ) {
die('parameters needed.'); die('parameters needed.');
} }
Expand Down
35 changes: 21 additions & 14 deletions back/tester_list.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */


session_start();

use Entities\Application,
Entities\Developer,
Entities\Device,
Entities\Invitation,
Entities\Tester,
Entities\Version;

require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../core/functions.php';
require_once __DIR__ . '/../core/Membership.php';

if (!Membership::isLoggedIn()) {
header('Location: ../index.php');
die();
}

$entityManager = initDoctrine();

?><!doctype html> ?><!doctype html>
<html> <html>
<head> <head>
Expand All @@ -28,8 +48,7 @@
<body> <body>


<?php include __DIR__ . '/../header.php';?> <?php include __DIR__ . '/../header.php';?>



<div id="content" class="box"> <div id="content" class="box">
<div class="boxtop"></div> <div class="boxtop"></div>
<div class="column first"> <div class="column first">
Expand All @@ -43,18 +62,6 @@


<?php <?php


use Entities\Application,
Entities\Developer,
Entities\Device,
Entities\Invitation,
Entities\Tester,
Entities\Version;

require_once __DIR__ . '/../core/index.php';
require_once __DIR__ . '/../core/functions.php';

$entityManager = initDoctrine();

// Retrieve all testers // Retrieve all testers
$testers = $entityManager->getRepository('Entities\Tester')->findAll(); $testers = $entityManager->getRepository('Entities\Tester')->findAll();


Expand Down
Loading

0 comments on commit 75d08dc

Please sign in to comment.