Compare commits

5 Commits
master ... bark

Author SHA1 Message Date
Singularity Viewer
9d1750eaaf Fix typos, fix download link for crash dumps 2016-06-17 05:37:18 +00:00
Singularity Viewer
c9e896c27e Let's allow our old users to log in 2014-07-10 23:30:17 +00:00
Singularity Viewer
dd61225eae Fixies 2014-07-09 20:43:16 +00:00
Latif Khalifa
980321b73f Fixed login redirect 2014-06-20 02:28:33 -04:00
Latif Khalifa
25939cc553 Don't save autoinsert IDs 2014-06-20 02:28:33 -04:00
7 changed files with 26 additions and 29 deletions

View File

@@ -11,11 +11,11 @@ if (!$S->isAnonymous() && $S->user->isAllowed())
Layout::header();
?>
<p>This application is used for analyzing crash reports and statitstics for the Singularity
<p>This application is used for analyzing crash reports and statistics for the Singularity
Viewer project.</p>
<p>Access to this tool is granted to the members of the development team.
The main goal is to identify the most common problems and improve the expierience
The main goal is to identify the most common problems and improve the experience
for the users of Singularity Viewer.</p>
<?php

View File

@@ -14,7 +14,6 @@ class DBH
function log($line)
{
return;
static $f = false;
static $failed = false;
@@ -50,7 +49,7 @@ class DBH
$this->db_pass = $db_pass;
$this->db_user = $db_user;
$this->db_host = $db_host;
$this->dbh = @mysql_pconnect($db_host, $db_user, $db_pass);
if (!$this->dbh) {
@@ -192,4 +191,4 @@ class DBH
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
?>
?>

View File

@@ -139,7 +139,7 @@ class User
*/
public static function getByEmail($email)
{
$query = kl_str_sql('SELECT * FROM users WHERE cust_id!=1 AND email=!s', $email);
$query = kl_str_sql('SELECT * FROM users WHERE email=!s', $email);
if (!$res = DBH::$db->query($query) OR !$row = DBH::$db->fetchRow($res)) {
return false;
} else {

View File

@@ -1,3 +1,6 @@
USE crashproc;
-- MySQL dump 10.13 Distrib 5.5.37, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: singucrash
@@ -31,7 +34,7 @@ CREATE TABLE `comment` (
`commented` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`comment` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `options`
@@ -54,7 +57,7 @@ CREATE TABLE `raw_reports` (
`processed` int(11) NOT NULL DEFAULT '0',
`raw_data` longtext,
PRIMARY KEY (`report_id`)
) ENGINE=InnoDB AUTO_INCREMENT=295850 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `reports`
@@ -115,7 +118,7 @@ CREATE TABLE `signature` (
`has_comments` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `hash` (`hash`)
) ENGINE=InnoDB AUTO_INCREMENT=6032 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `users`
@@ -131,7 +134,7 @@ CREATE TABLE `users` (
`is_admin` tinyint(4) DEFAULT NULL,
`is_allowed` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Dump completed on 2014-05-20 9:06:08

View File

@@ -2,21 +2,4 @@
define("SITE_ROOT", realpath(dirname(__file__)));
require_once SITE_ROOT . "/lib/init.php";
$google_gateway = Layout::getLoginGateway();
Layout::header();
?>
<p>Please use your <a href="<?php echo $google_gateway->getRequestURL(); ?>">Google Account</a> to login.</p>
<?php
Layout::footer();
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
http::redirectAbsolute( GoogleLogin::loginURL());

View File

@@ -14,6 +14,18 @@ $user_email = GoogleLogin::userEmail();
$user = User::getByLogin($user_identity);
if (!$user)
{
var_dump($user_email);
$user_tmp = User::getByEmail($user_email);
if($user_tmp /* && (!$user->login) || ($user->login == "")*/)
{
$user = $user_tmp;
$user->login = $user_identity;
$user->update();
}
}
if (!$user)
{
$user = new User();

View File

@@ -131,7 +131,7 @@ $(function() {
</tr>
<tr>
<th>Minidump</th>
<td><a href="download.php/singularity<?php echo (int)$report->id ?>.dmp?report_id=<?php echo (int)$report->id ?>">Download</a></td>
<td><a href="download.php?report_id=<?php echo (int)$report->id ?>">Download</a></td>
</tr>
</table>
</div>