Skip to content

Commit

Permalink
Ajustes no session_start()
Browse files Browse the repository at this point in the history
Verifica se a sessão já não foi iniciada antes de chamar a função.
  • Loading branch information
gavlinski committed Jan 14, 2013
1 parent 3e2cd37 commit a52f6de
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/

session_start();
if (!isset($_SESSION))
session_start();
if (isset($_SESSION["oauth_token"])) {
$file = $_SESSION["file"];
$venues = $_SESSION["venues"];
Expand Down
3 changes: 2 additions & 1 deletion edit_csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/

session_start();
if (!isset($_SESSION))
session_start();
if (isset($_SESSION["oauth_token"])) {
$oauth_token = $_SESSION["oauth_token"];
$file = $_SESSION["file"];
Expand Down
3 changes: 2 additions & 1 deletion flag_csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/

session_start();
if (!isset($_SESSION))
session_start();
if (isset($_SESSION["oauth_token"])) {
$oauth_token = $_SESSION["oauth_token"];
$file = $_SESSION["file"];
Expand Down
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@

// Otherwise save the token in a session variable and redirect browser
} else {
session_start();
if (!isset($_SESSION))
session_start();
$_SESSION["oauth_token"] = $token;

// Save and configure a cookie to expire in 15 days
Expand Down
3 changes: 2 additions & 1 deletion load.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/

session_start();
if (!isset($_SESSION))
session_start();
if (!isset($_SESSION["oauth_token"])) {
header('Location: index.php');
}
Expand Down
3 changes: 2 additions & 1 deletion load_csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/

session_start();
if (!isset($_SESSION))
session_start();
if (!isset($_SESSION["oauth_token"])) {
header('Location: index.php');
}
Expand Down
3 changes: 2 additions & 1 deletion main.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/

session_start();
if (!isset($_SESSION))
session_start();
if (isset($_SESSION["oauth_token"])) {
$oauth_token = $_SESSION["oauth_token"];
} else {
Expand Down

0 comments on commit a52f6de

Please sign in to comment.