|
Password changing. I'm setting up a Turn Key Linux wiki server and have got most of the things we need sorted out. Just need one more thing I need a method to change passwords (email is disabled as its going to be a private wiki so no reset via email). Here is my server information: MySQL * Server: Localhost via UNIX socket * Server version: 5.1.41-3ubuntu12.8 * Protocol version: 10 * User: root@localhost * MySQL charset: UTF-8 Unicode (utf8) Web server * Apache/2.2.14 (Ubuntu) * MySQL client version: 5.1.41 * PHP extension: mysql phpMyAdmin * Version information: 3.3.2deb1ubuntu1 I'm in the php MyAdmin pages: localhost - wiki_db SQL tab googling suggests that I use the following command: mysql> UPDATE mysql.user SET Password = PASSWORD('monday') -> WHERE Host = 'localhost' AND User = '53656e647362'; mysql> FLUSH PRIVILEGES; The user "53656e647362" exists in the Browse tab as a user and corresponds to the person I'm experimenting on I get an error: ----------------------------------------------------------------------------------- Error There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem ERROR: Unknown Punctuation String @ 64 STR: -> SQL: mysql> UPDATE mysql.user SET Password = PASSWORD('monday') -> WHERE Host = 'localhost' AND User = '53656e647362';mysql> UPDATE mysql.user SET Password = PASSWORD('monday') -> WHERE Host = 'localhost' AND User = '53656e647362';mysql> UPDATE mysql.user SET Password = PASSWORD('monday') -> WHERE Host = 'localhost' AND User = '53656e647362'; SQL query: mysql> UPDATE mysql.user SET Password = PASSWORD('monday') -> WHERE Host = 'localhost' AND User = '53656e647362'; MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> UPDATE mysql.user SET Password = PASSWORD('monday') -> WHERE Host = ' at line 1 ----------------------------------------------------------------------------------- Sorry for the probably very basic query but am I going about this the right way?
|
# ? Mar 5, 2012 17:15 |
|
|
# ? May 15, 2024 18:48 |
|
Well there's a -> right in the middle of your query before the WHERE statement.
|
# ? Mar 5, 2012 17:34 |
|
Are you typing in "mysql>" and "->" command prompts literally as part of the query? Try just using the following: UPDATE mysql.user SET Password = PASSWORD('monday') WHERE Host = 'localhost' AND User = '53656e647362';
|
# ? Mar 5, 2012 20:37 |
|
Hammerite posted:Are you typing in "mysql>" and "->" command prompts literally as part of the query? Try just using the following: nope not typing the mysql> part (figured that out a few days ago ) just ran the command and got the following: 0 row(s) affected. ( Query took 0.0017 sec ) so progress (it doesn't give an error) but not a result. I then tried using the user real id field at the end: User = '4465616e204275726e657474' and again got: 0 row(s) affected. ( Query took 0.0018 sec ) any thoughts? I tried logging in using the username and the password its should have changed too 'monday' no joy.
|
# ? Mar 6, 2012 10:34 |
Does this return any rows?code:
|
|
# ? Mar 6, 2012 10:40 |
|
fletcher posted:Does this return any rows? Tried FLUSH PRIVILEGES; no joy am rebooting the server to see if that has any effect. reboot didn't touch it lets try your next step: code:
MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0013 sec ) so it looks like I'm identifying the user wrong.
|
# ? Mar 6, 2012 10:48 |
Then just try (may not want to post the results of this query here):code:
edit: also be aware there are people out there looking for ways into your system, I see poo poo like this in my logs daily: code:
fletcher fucked around with this message at 10:55 on Mar 6, 2012 |
|
# ? Mar 6, 2012 10:51 |
|
fletcher posted:Then just try (may not want to post the results of this query here): Get this: Showing rows 0 - 4 (5 total, Query took 0.0013 sec) Will get a screen shot: as this is a temp setup to be rebuilt when I have the kinks worked out. Edit - ye gods sorry about the screenshot size Edit 2 - this is not on the public internet its on a private ip range behind a proper firewall setup the address isn't publically available seadweller fucked around with this message at 11:02 on Mar 6, 2012 |
# ? Mar 6, 2012 10:58 |
|
seadweller posted:Get this: How do I figure out which of the entries is the one I need?
|
# ? Mar 6, 2012 11:23 |
|
seadweller posted:How do I figure out which of the entries is the one I need? code:
The Gripper fucked around with this message at 13:13 on Mar 6, 2012 |
# ? Mar 6, 2012 13:10 |
|
Facebook is killing off FBML. Unfortunately, that's the only way I know of to do the "invite friends to this site" thing. FB's own site includes a blurb about how some of these features are possible with social plugins but I can't find any tutorials or docs that point me in the right direction. Any ideas?
|
# ? Mar 6, 2012 14:11 |
|
klem_johansen posted:Facebook is killing off FBML. Unfortunately, that's the only way I know of to do the "invite friends to this site" thing. FB's own site includes a blurb about how some of these features are possible with social plugins but I can't find any tutorials or docs that point me in the right direction. Any ideas? I'm no facebook expert but this blog was published today: http://anandafit.info/2011/03/06/invite-friends-to-your-site-in-facebook-invite-app/ And has php examples.
|
# ? Mar 6, 2012 19:57 |
|
Scaramouche posted:I'm no facebook expert but this blog was published today: Check your year... That looks like an example of the code that is being deprecated.
|
# ? Mar 6, 2012 20:03 |
|
Don't tell me you're one of those people who think 2000 actually counted as a year
|
# ? Mar 6, 2012 20:17 |
|
edit: figured it out
|
# ? Mar 6, 2012 23:58 |
|
What's up with preg_match requiring you to delimit your regex with a special character? Wouldn't it make more sense if it just took the whole string and used it as a regex? Am I missing something huge here?
|
# ? Mar 7, 2012 14:49 |
|
rt4 posted:What's up with preg_match requiring you to delimit your regex with a special character? Wouldn't it make more sense if it just took the whole string and used it as a regex? Am I missing something huge here? If you want to supply switches to modify the regex engine's behaviour, you add them after the ending character. Like i for case-insensitive matching. code:
|
# ? Mar 7, 2012 15:18 |
|
This makes perfect sense in Perl, where you don't need the single/double quotes as string delimiters, and you can just put m/blah/flags right there in the code literally. PHP just wrapped that up in a low-effort sort of way which makes it more inconvenient.
|
# ? Mar 7, 2012 16:50 |
|
It's a wart of PCRE, really...
|
# ? Mar 7, 2012 17:04 |
|
Scaramouche posted:I'm no facebook expert but this blog was published today: Unfortunately, it is also based on FBML. When I look up the docs I get a big bold warning that FBML apps will no longer work as of June of this year. I'm not sure from the warning whether or not some of these functions will even be possible after that date.
|
# ? Mar 7, 2012 20:07 |
|
So I'm working on a website for people to share PS Vita Wallpapers, and I'm looking for a good, secure login system. I've looked at frameworks like symfony and it just seems like trying to do brain surgery with a chainsaw. I've also looked at using OpenID, and have a semi-functional "log in with google" button. Which is fine, except it seems a) no such thing as a logout, and b) I don't seem to have any persistance with the basic setup (I'm using LightOpenID). I realize I'm going to have to dump their login info into a database, just for sanity's sake, but I can't seem to get it to tell me if they're actually logged in.. Does anyone have any good suggestions? I'm okay with ditching OpenID, and implementing something entirely local, but I would like to get it working for that sweet Google e-cred.
|
# ? Mar 12, 2012 04:43 |
|
I need to make an API for an existing PHP application (that I didn't write and is kind of a mess, but that's beside the point) and I was looking into some frameworks that claim to make writing a RESTful API easier. Anyone have experience or opinions on any of these, or other suggestions? I was looking at http://getfrapi.com/ http://www.slimframework.com/ http://www.recessframework.org and https://github.com/evantahler/PHP-DAVE-API I don't really want to use it for more than an API, so DAVE seems like the best for what I want, since it is the lightest weight, but if anyone has used one of these or something else and wants to weigh in, that would be cool.
|
# ? Mar 12, 2012 19:58 |
|
coaxmetal posted:I need to make an API for an existing PHP application (that I didn't write and is kind of a mess, but that's beside the point) and I was looking into some frameworks that claim to make writing a RESTful API easier. I'm using Symfony2 to make a RESTful API, and I wrote a Bundle for it so it's dead simple - https://github.com/brightmarch/BrightmarchRestfulBundle Symfony2 is pretty nice, I think. Slim is nice and easy to set up, but it looks like it wouldn't scale well to writing large apps. Recess hasn't been updated in ages (https://github.com/recess/recess/) and doesn't require PHP5.3. Edit: DAVE looks neat though, no experience with it, unfortunately. musclecoder fucked around with this message at 20:35 on Mar 12, 2012 |
# ? Mar 12, 2012 20:31 |
|
THanks, That looks cool, although symphony2 looks like a little more than what I want. Looking around some more I also found apify (https://github.com/apify/apify-library) so I'm going to check that out as well.
|
# ? Mar 12, 2012 22:01 |
|
What are the primary differences between symfony2 and codeigniter? (or Kohana)
|
# ? Mar 12, 2012 22:59 |
|
revmoo posted:What are the primary differences between symfony2 and codeigniter? (or Kohana) I've never used Code Igniter or Kohana, so I can't give you much info there. Symfony2 is a total rewrite of the 1.x series. It requires PHP 5.3+ and is very large. It can be slow at times (especially Doctrine), but it enables you a great deal of freedom to fine tune it. The nicest thing I like about Symfony2 is the bundle system. Everything (including the framework itself) lives inside a bundle. A bundle is pretty much a module that's dead simple to install. If you see my link above, I talk about installing the bundle. You update a file to include the Github location of the bundle, run a command, and edit a file and it's installed. Then to use it, you just tell your script to use the class and you're good to go. Symfony2 is a memory hog. A basic request in the production environment is 8MB (on PHP5.4). Running my test suite of only 27 tests and 35 assertions yields 64MB of memory used by PHPUnit (you can get this way down by running each test in a separate process, but that takes a lot longer). 8MB per request is a lot for me, I usually shoot for between 1-2MB and after 2 I start feeling it's using too much RAM to satisfy requests. I'm going to try to remove some unnecessary bundles to see if that helps as well. Overall, I really dig it. I usually write my own frameworks, but for a new project I wanted to give another one a shot so I didn't have to worry about the boiler plate stuff. The documentation is getting there, but you'll still spend a fair amount of time on Stackoverflow, Google Groups, or browsing through the code to fully grok something.
|
# ? Mar 13, 2012 02:20 |
|
Got the password change thing worked out here is the working code if anyone else was interested update user set user_password=md5(concat(user_id, '-', md5('NEWPASSWORD'))) where user_name='USERNAME'; NEWPASSWORD is the new password for the user, and USERNAME is the user's name (first letter must be capatalized!) thanks for the help!
|
# ? Mar 14, 2012 10:54 |
|
You really shouldn't be using MD5 for storing passwords: http://codahale.com/how-to-safely-store-a-password/
|
# ? Mar 14, 2012 17:19 |
|
Optimus Prime Ribs posted:You really shouldn't be using MD5 for storing passwords: http://codahale.com/how-to-safely-store-a-password/
|
# ? Mar 14, 2012 17:37 |
|
I'm really hoping someone can help me here because I'm completely stumped. I have a CodeIgniter site which has a controller called "tip" (it's a football tipping site). The tip controller looks like this: php:<? include_once 'app.php'; class Tip extends App { function __construct() { parent::__construct(); } function index() { echo 'test'; } function save() { echo 'test'; } } ?> quote:HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request. The bizarre part here is that exact page works if I rename the file and the class to something else and try that instead, but if I try to call it 'tip' it doesn't work. I even had that specific controller, named tip, working perfectly before and it had a lot worse code in it than what is there now. At some point the whole thing fell over so I dumbed the code down to the bare essentials for the sake of debugging, but no luck - even with the code so dumbed down it doesn't work with that specific name.
|
# ? Mar 22, 2012 13:47 |
|
Does "app" work?
|
# ? Mar 22, 2012 13:52 |
|
rt4 posted:Does "app" work? Yeah sorry, forgot to mention that all of other functioning controllers start the same way. Also this specific file works fine if I simply change its name and nothing else, so I don't think app is causing it. It's making my head hurt.
|
# ? Mar 22, 2012 14:02 |
|
Gnack posted:Yeah sorry, forgot to mention that all of other functioning controllers start the same way. The behaviour you describe is strange, because "Tip" is not a keyword in PHP.
|
# ? Mar 22, 2012 14:05 |
|
Any funny business going on in your .htaccess? Any hooks?
|
# ? Mar 22, 2012 14:09 |
|
Gnack posted:Yeah sorry, forgot to mention that all of other functioning controllers start the same way. What's the name of the file? i.e. what's the name of the file when it doesn't work, and what its name when it does work?
|
# ? Mar 22, 2012 14:15 |
|
Oh sweet jesus I'm sorry guys, I found the problem. I had another class being created elsewhere called 'Tip'... ugh! I think this is evidence that I've been up too long.
|
# ? Mar 22, 2012 14:18 |
|
Was it a model? I really wish I could give models and controllers the same name.
|
# ? Mar 22, 2012 14:20 |
|
klem_johansen posted:Unfortunately, it is also based on FBML. When I look up the docs I get a big bold warning that FBML apps will no longer work as of June of this year. I'm not sure from the warning whether or not some of these functions will even be possible after that date. Facebook has completely migrated all of the FBML functionality to their Javascript SDK. You can find the docs about this sdk here: https://developers.facebook.com/docs/reference/javascript/ A more specific example about inviting friends (app requests) can be found here: https://developers.facebook.com/docs/reference/dialogs/requests/
|
# ? Mar 22, 2012 18:03 |
|
rt4 posted:Was it a model? I really wish I could give models and controllers the same name. You can with namespaces.
|
# ? Mar 22, 2012 18:32 |
|
|
# ? May 15, 2024 18:48 |
|
edit: fixed.
oRenj9 fucked around with this message at 21:34 on Mar 22, 2012 |
# ? Mar 22, 2012 21:09 |