Skip to content

Commit

Permalink
bugfix negative authentifizierung fürt zu exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan committed Dec 4, 2012
1 parent 5265413 commit 9b17065
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 64 deletions.
21 changes: 21 additions & 0 deletions app/styles/bootstrap.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/templates/localeedit/editItem.html
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="edit-wrapper-inner container "> <div class="edit-wrapper-inner container ">
<div class="edit-wrapper-inner row-fluid"> <div class="edit-wrapper-inner row-fluid">
<div class="pull-left span4 key hero-unit"> <div class="pull-left span4 key well">
<span class="label"><%= index %></span> <span class="label"><%= index %></span>
<span><%= model.get("LocaleKey") %></span> <span><%= model.get("LocaleKey") %></span>
</div> </div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/localeedit/filter.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<span id="prevPage" class="label">< prev</span> <span id="prevPage" class="label">< prev</span>
<span id="nextPage" class="label">next > </span> <span id="nextPage" class="label">next > </span>


<select id="SelElementsPerPage" class="dropdown"> <select id="SelElementsPerPage" class="input-small shadow_slect">
<option value="5">5</option> <option value="5">5</option>
<option value="10">10</option> <option value="10">10</option>
<option value="20">20</option> <option value="20">20</option>
Expand Down
36 changes: 21 additions & 15 deletions localeEditFileManager.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,22 +82,28 @@ exports.GetUserFiles = function(req, res) {
for (var i in jsOnlyFiles) { for (var i in jsOnlyFiles) {
var file = jsOnlyFiles[i]; var file = jsOnlyFiles[i];
var statsDone = 0; var statsDone = 0;


fs.stat(dirName+'/' + file, function(err, stats){ var stats = fs.statSync(dirName+'/' + file);

jsOnlyFilesWithMetaInfo.push({
jsOnlyFilesWithMetaInfo.push({ Name: file,
Name: file, mtime: stats.mtime,
mtime: stats.mtime, size: stats.size
size: stats.size });
});
statsDone +=1; // fs.stat(dirName+'/' + file, function(err, stats){
if(statsDone === jsOnlyFiles.length){
doResponse(); // jsOnlyFilesWithMetaInfo.push({
} // Name: file,
}); // mtime: stats.mtime,

// size: stats.size

// });
// statsDone +=1;
// if(statsDone === jsOnlyFiles.length){
// doResponse();
// }
// });
} }
doResponse();
}); });
}; };


Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"passport-local": "*", "passport-local": "*",
"ejs": "*", "ejs": "*",
"jquery-file-upload-middleware": "*", "jquery-file-upload-middleware": "*",
"node-linq": "*y", "node-linq": "*",
"mv": "*" "mv": "*",
"connect-flash": "*"
} }
} }
15 changes: 11 additions & 4 deletions server.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ var connect = require('connect')
, filemanager = require('./localeEditFileManager') , filemanager = require('./localeEditFileManager')
, passport = require('passport') , passport = require('passport')
, util = require('util') , util = require('util')
, flash = require('connect-flash')
, LocalStrategy = require('passport-local').Strategy; , LocalStrategy = require('passport-local').Strategy;


var users = [ var users = [
{ id: 1, username: 'admin', password: 'mclaren', email: 'bob@example.com' } { id: 1, username: 'admin', password: 'mclaren', email: 'bob@example.com' },
, { id: 2, username: 'stephan', password: 'mclaren', email: 'joe@example.com' } { id: 2, username: 'ralf', password: 'mclaren', email: 'bob@example.com' },
{ id: 3, username: 'felix', password: 'mclaren', email: 'bob@example.com' },
{ id: 4, username: 'arne', password: 'mclaren', email: 'bob@example.com' },
{ id: 5, username: 'torben', password: 'mclaren', email: 'bob@example.com' },
{ id: 6, username: 'björn', password: 'mclaren', email: 'bob@example.com' },
{ id: 7, username: 'stephan', password: 'mclaren', email: 'joe@example.com' }
]; ];


function findById(id, fn) { function findById(id, fn) {
Expand Down Expand Up @@ -73,7 +79,7 @@ passport.use(new LocalStrategy(
}) })
}); });
} }
)); ));






Expand All @@ -92,6 +98,7 @@ app.configure(function(){
// persistent login sessions (recommended). // persistent login sessions (recommended).
app.use(passport.initialize()); app.use(passport.initialize());
app.use(passport.session()); app.use(passport.session());
app.use(flash());
app.use(app.router); app.use(app.router);
app.use(express.static(__dirname + '/../../public')); app.use(express.static(__dirname + '/../../public'));
app.use(express.errorHandler({ app.use(express.errorHandler({
Expand Down Expand Up @@ -233,7 +240,7 @@ function staticRequest (req, res){




app.get('/login', function(req, res){ app.get('/login', function(req, res){
res.render('login', { user: req.user, message: '' }); res.render('login', { user: req.user, message: 'Login' });
}); });


app.post('/upload', uploadHandler); app.post('/upload', uploadHandler);
Expand Down
41 changes: 0 additions & 41 deletions views/layout.jade
Original file line number Original file line Diff line number Diff line change
@@ -1,41 +0,0 @@
!!! 5
//if lt IE 7
html.no-js.ie6.oldie(lang='en')
//if IE 7
html.no-js.ie7.oldie(lang='en')
//if IE 8
html.no-js.ie8.oldie(lang='en')
//[if gt IE 8]><!
html.no-js(lang='en')
//<![end if]
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1')
title=title
meta(name="description", content=description)
meta(name="author", content=author)
meta(name="viewport", content='width=device-width, initial-scale=1')
link(rel='stylesheet', href='/css/style.css')
//-script(src='js/libs/modernizr-2.0.6.min.js')
body
block header

block content

block footer
footer
script(src='//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js')
script
window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\\/script>')
//-script(defer, src='js/plugins.js')
script(defer, src='/js/script.js')
script(defer, src='/socket.io/socket.io.js')
script
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview'],['_trackPageLoadTime']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
//if lt IE 7
script(defer, src='//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js')
script(defer)
window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})

0 comments on commit 9b17065

Please sign in to comment.