60 Commits

Author SHA1 Message Date
Fabien O'Carroll
7703c24d1a Adding user settigns db methods 2014-02-17 11:41:45 +00:00
Remy Sharp
1dc5992580 Get enough data from DB to ensure we're working with deleted bin 2014-01-27 14:53:07 +00:00
Remy Sharp
c1d2cdfaad Initial delete bin feature working.
Currently behind "delete" feature available to teamjsbin for testing.
2014-01-27 14:51:27 +00:00
Fabien O'Carroll
ad223e0398 Removing getVisibility references 2014-01-16 11:04:08 +00:00
Fabien O'Carroll
367406149f Adding visibility to setBinOwner 2014-01-14 16:04:33 +00:00
Fabien O'Carroll
bc127c83a0 Renaming binWithOWner to binMetadata 2014-01-14 15:19:59 +00:00
Fabien O'Carroll
3714e0d355 Merge branch 'feature/pro_user_flag' of https://github.com/remy/jsbin into feature/private_bins
* 'feature/pro_user_flag' of https://github.com/remy/jsbin: (23 commits)
  Adding TODO
  Adding explaination of req.user and req.session.user
  Using request.session.user not request.user
  Updating route to set pro, doesn't require username now
  Using current user to setPro rather than url param
  Adding setPro variable, will be used later
  Updating sessionHandler.setProAccount
  Removing console.log
  Ammending mysql to use query over run
  Adding example 'Pro Feature'
  Implementing setProAccount for mysql db
  Adding setProAccount method to file db
  Testing console logs
  Adding pro data for index render
  Adding pro to the request.user obj
  Adding setProAccount method
  Visual indicator of pro account to login box
  Adding test router handler
  Adding setProUser method
  Adding DB update scripts
  ...

Conflicts:
	lib/db/mysql.js
	lib/db/sql_templates.json
	lib/store.js
	views/index.html
2014-01-14 12:55:23 +00:00
Fabien O'Carroll
8998565c35 Adding setBinVisibility method 2014-01-14 12:49:19 +00:00
Fabien O'Carroll
2fd3b62764 Renaming isPrivate to getVisibility 2014-01-13 15:47:11 +00:00
Fabien O'Carroll
dd28843b5c Adding getBinOwner sql template 2014-01-13 15:46:50 +00:00
Fabien O'Carroll
7fa41d6543 Adding isPrivate sql template 2014-01-13 15:03:55 +00:00
Remy Sharp
c157eb47da MySQL doesn't need SET NAME, also changed get history query 2014-01-07 14:26:51 +00:00
Fabien O'Carroll
014461f345 Adding setProAccount SQL query template 2014-01-03 16:13:13 +00:00
Remy Sharp
131d75968c Extended /<user>/last support to /<user>/last-n
So /rem/last still works, but also /rem/last-1 gives me the penulimate bin I worked on.
2013-11-02 15:38:23 +00:00
Remy Sharp
605a1910a8 Fixed server exploding - too few parameters given
MySQL was expecting the github data, but not being pass it - and it was causing the node process to crash and restart - mayhem.
2013-07-04 18:37:52 +01:00
Tom Ashworth
d54d4d3735 Redo github logic to fix incorrect linking. 2013-07-04 13:20:02 +01:00
Remy Sharp
0f1b36d0a6 Merge branch 'master' into fix/avatar-as-menu-655
Conflicts:
	lib/handlers/bin.js
	lib/models/user.js
2013-07-04 11:25:44 +01:00
Remy Sharp
9c9846becd add getUserBinCount to db adapters 2013-06-28 15:59:39 +01:00
Tom Ashworth
482a3daa84 Hook Github to existing user. 2013-06-24 11:14:13 +01:00
Tom Ashworth
2d5195bbc9 Support creating a new user with gihub, but sessions are broken. 2013-06-18 13:44:55 +01:00
Matthew O'Riordan
a234941cf3 API can require an API key for a user (disallow anonymous) 2013-05-20 07:18:57 +02:00
Remy Sharp
be56fa0db8 If logged-in user created first revision of a bin, then they "own" the bin url - and other users will only be able to clone the url 2013-04-05 22:09:12 +01:00
Remy Sharp
ea37a303e2 reverting change to SQL - only server change that could be causing cpu spike. ref #511 2013-03-13 09:03:03 +00:00
Remy Sharp
09b27214d8 increase amount of data sent back (and remove legacy codemirror). ref #511 2013-03-11 17:27:18 +00:00
Remy Sharp
c890fe8b56 fixed archives again - got killed via the query update 2013-02-19 22:29:46 +00:00
Remy Sharp
f8b19416e5 revive the good home query 2013-02-12 23:10:22 +00:00
Tom Ashworth
fbe6a22785 Use archive (not active) everywhere. 2013-01-14 15:14:09 +00:00
Tom Ashworth
653622b5f9 Bins are archiveable. 2013-01-14 15:05:20 +00:00
Tom Ashworth
0cc499a7d3 add support to the owners table for panels with content, and unified the setBinOwner, setBinForUser, assignBin, et al 2013-01-09 16:50:33 +00:00
Tom Ashworth
d0d1bc4d94 Use created date from sandbox to fix missing timestamps. 2013-01-09 12:14:18 +00:00
Tom Ashworth
cd2dff7202 Chunk the owners table to populate it slowly. 2013-01-09 10:23:37 +00:00
Tom Ashworth
20cc16186a Population tool. 2013-01-08 11:00:24 +00:00
Tom Ashworth
1e0e62f377 Restore missing backtick and put error handler before use of results. 2013-01-07 14:19:34 +00:00
Tom Ashworth
892b6427b1 Include created in getBinsByUser query. 2013-01-07 13:57:11 +00:00
Tom Ashworth
ef26dfd41d Update SQL with owners.summary 2013-01-07 12:01:08 +00:00
Remy Sharp
952bfb43c4 another attempt to fix the home page listing the actual code - fixed by sending less data from mysql to node by using substr...think it actually works! 2012-10-04 13:21:40 +01:00
Remy Sharp
fa322f6414 Filthy way of getting home listing working again.
This solution is obviously a hack, and doesn't provide the detected
content, but gets the history working again to browse. Something's
wrong with the innodb tables and causes the database to hang (looking
for help here!).

Ref #333
2012-09-12 00:13:00 +01:00
Remy Sharp
2d47d76472 Attempt to optimise the insane amount of time it takes to get the user home list. Currently 24s for 'rem'.
The old code would make one query for all the urls and revisions, then
loop and individual query each bin. If the user has 100+ bins, then it
gets slow and expensive because we can't group these queries together.

I've changed this so that the query simply joins the owners and sandbox
table, so instead of *just* getting the url and revision as previously,
we're now getting all the data in one request.  I've also removed the
sorting as this happens entirely in the code.

The query, live for my own homepage is 1.13 seconds. I'm hoping
therefore the sum change of this update will reduce the 24 seconds down
to 1-2 seconds.

One additional change I'd like would be to only make the request for
the `/list` page if the user really goes there, or perhaps hovers over
their home link - as a preemptive request - so we're not always making
the request for their home urls.
2012-09-01 08:34:56 +01:00
Jon Linklater-Johnson
cfa3aa3b6d Flag abuse was missing 5626d3942ad99acaa810e426557239ec8dc2495a - so I cherry-picked it back in and resolved the conflict 2012-08-25 19:36:20 +01:00
Remy Sharp
b9f1bfae2b Don't automatically take down bins 2012-08-25 11:49:34 +02:00
Jon Linklater-Johnson
43c94f6f8e Add store methods for abuse reporting 2012-08-25 11:41:25 +02:00
Remy Sharp
a4eb247ad4 Support log in using email as well as username. Fixes #314 2012-08-21 23:16:06 +01:00
Remy Sharp
40137a170c Create revision correctly updates "last_updated" making it set to /[user]/last/ 2012-08-21 13:59:27 +01:00
Remy Sharp
1fefc3fc84 Don't look for recent bins that haven't been updated…obviously 2012-08-17 15:21:41 +01:00
Aron Carroll
6f223539ea Add a template for upgrading a users password
This also sets the created timestamp. We really need to get a SQL
builder module in the next version!
2012-07-23 23:02:18 +01:00
Remy Sharp
57ff9cdda3 Capture processor on first save and milestones. Also disable code casting until bin is owned. 2012-07-22 11:55:22 +01:00
Remy Sharp
c71835a72b BOOM. Closes #176
Now just need @aron to implement server side rendering so the previews
work now (that I've broken them with this support! :)
2012-07-13 17:56:49 +01:00
Remy Sharp
90065b9450 Update last_updated col on owners so that /rem/last always points to last active (includes db change) 2012-07-08 00:25:45 +01:00
Aron Carroll
29bdb842c3 Remove all instances of NOW() from the sql templates 2012-07-06 17:12:25 +01:00
Remy Sharp
57ce5ec7ac Allow user to use permalink /rem/last for easy device testing 2012-07-05 00:26:14 +01:00