# |
Apr 21st 2017, 16:20 |
hmic |
there is lots of things that need to be fixed |
# |
Apr 21st 2017, 16:19 |
Dinossaur |
Literal queries was done on my first encounter with CakePHP. I just had not learn ORM then. Not escaping was a blunder. I'll fix it |
# |
Apr 21st 2017, 16:15 |
hmic |
are you kiding me? |
# |
Apr 21st 2017, 16:15 |
hmic |
$conn->execute($query); |
# |
Apr 21st 2017, 16:15 |
hmic |
); |
# |
Apr 21st 2017, 16:15 |
hmic |
$_SERVER['clienteDominio'] |
# |
Apr 21st 2017, 16:15 |
hmic |
$req->query['Usuario_id'], |
# |
Apr 21st 2017, 16:15 |
hmic |
$entity->id, |
# |
Apr 21st 2017, 16:15 |
hmic |
you use literal queries with user data, not escaping it at all, not binding the values at least and not using the orm in the same function for no reason? $query = sprintf("insert ignore into sis_usuario_perfil (Perfil_id,Usuario_id,Cliente_id) values (%d,%d,%d)", |
# |
Apr 21st 2017, 16:15 |
Dinossaur |
sorry... I'm not sure what is "super globals from a tables callback function"... |
# |
Apr 21st 2017, 16:14 |
Dinossaur |
https://thepasteb.in/p/vghOxz56BZof3 |
# |
Apr 21st 2017, 16:14 |
hmic |
no wonder this spits on you! |
# |
Apr 21st 2017, 16:14 |
hmic |
you are setting super globals from a tables callback function? |
# |
Apr 21st 2017, 16:14 |
hmic |
$_SERVER['ENTITY'] = $entity; |
# |
Apr 21st 2017, 16:14 |
hmic |
you know what, that code is really really bad! check this: if (isset($req->query['Usuario_id'])) { |
# |
Apr 21st 2017, 16:12 |
hmic |
can you show the query from UsersController line 147? |
# |
Apr 21st 2017, 16:08 |
Dinossaur |
@hmic i made the changes, but the error persists as before. |
# |
Apr 21st 2017, 16:06 |
hmic |
probably you just need to add the behaviour after setting the tablename and alias, so move that line further down |
# |
Apr 21st 2017, 16:05 |
hmic |
additionally call parent::initialize in the end of that function, not the beginning |
# |
Apr 21st 2017, 16:04 |
hmic |
Dinossaur, do you need the setAlias('users') really? - i dont use that. and if you do, make sure it reads "Users" not "users" IMHO |
# |
Apr 21st 2017, 16:04 |
birdy247 |
import charges |
# |
Apr 21st 2017, 16:03 |
hmic |
does it matter? costs 50$ shipping and a week of waiting |
# |
Apr 21st 2017, 16:02 |
birdy247 |
Im UK |
# |
Apr 21st 2017, 16:02 |
birdy247 |
All in the states |
# |
Apr 21st 2017, 16:02 |
hmic |
these are dead cheap! |
# |
Apr 21st 2017, 16:02 |
birdy247 |
I think id rather just buy new for ease of life |
# |
Apr 21st 2017, 16:01 |
hmic |
if the smart values of the disks are ok, you could maybe get a year or so out of them before needing to replace them really. for me thats just not worth it. but if you do backups - really do them, you will be good with one of those for quite some time. they do use enterprise harddisks and ssds, so the wear should be bearable. but you never know where the machines come from... |
# |
Apr 21st 2017, 15:59 |
hmic |
www.ebay.co.uk/itm/LENOVO-THINKSTATION-S30-M-XEON-E5-2665-8C-2-4GHZ-DDR3-48-0GB-1TBx2-256-GB-SSD/262935543897 |
# |
Apr 21st 2017, 15:59 |
birdy247 |
I need 2 |
# |
Apr 21st 2017, 15:58 |
hmic |
buy a new samsung ssd and bob's your uncle |
# |
Apr 21st 2017, 15:58 |
hmic |
but the more current p310 is a good choice too, just get a xeon and ecc ram, if you ask me |
# |
Apr 21st 2017, 15:58 |
hmic |
it has ecc ram and an xeon e5 server cpu... and is really really cheap for this kind of hardware |
# |
Apr 21st 2017, 15:57 |
hmic |
my current workstation is similar to this, just with ssd and different graphics |
# |
Apr 21st 2017, 15:57 |
hmic |
http://www.ebay.co.uk/itm/Lenovo-ThinkStation-S30-Xeon-E5-1620-3-60GHz-Quad-Core-16GB-DDR3-Win10-pro-K600-/122416688150?hash=item1c809a6c16:g:j7kAAOSw4A5Y2Ckf |
# |
Apr 21st 2017, 15:56 |
hmic |
yes |
# |
Apr 21st 2017, 15:56 |
birdy247 |
so youd buy a refurb and swap out the hard disk? |
# |
Apr 21st 2017, 15:55 |
hmic |
anything but the disks, yes. |
# |
Apr 21st 2017, 15:55 |
Dinossaur |
@hmic https://thepasteb.in/p/Elh1L524y5wCm |
# |
Apr 21st 2017, 15:55 |
birdy247 |
would you go refurb? |
# |
Apr 21st 2017, 15:54 |
hmic |
birdy247: i like the thinkstations more, you can order them with proper server cpus and ecc memory, which is important to me. |
# |
Apr 21st 2017, 15:54 |
birdy247 |
http://www.ebay.co.uk/itm/Lenovo-ThinkStation-P310-i7-6700-16Gb-256Gb-SSD-GC-Win-7-Pro-/262932515453?_trksid=p2385738.m2548.l4275 |