Trouble with change language as admin in config Trouble with change language as admin in config
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Trouble with change language as admin in config

Started by andrez1, November 29, 2005, 05:07:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

andrez1

Tread marked as fixed:

http://forum.coppermine-gallery.net/index.php?topic=24075.0

I guess its kind of parked and not read. So i assume the right thing is to post a new topic. Here it goes:

Whatever can be set and stored in cookies as language preference based on list-box on frontside: Works OK. With or without nibblers fix.

But changing, as admin, in 'configuration'-menu, language: Does not work properly. 

The place to check is wether the 'cpg140_config' -table change the 'name' "lang" to 'value' "english" (or whatever chosen) or not when requested.

I would like to set language to norwegian and remove listbox and language-flags on frontpage. And i can not do that from config meny as long as the database not gets the message  'name' "lang" to 'value' "norwegian"

That is with the fix in place.

I have looked more  into it. 

If display language is lets say 'english' chosen from listbox (and stored in cookie i guess), the admins' config menu on language present 'english' as the choice, other languages can be chosen, and will get updated   in cpg140_config if chosen.

but:

If display language is changed to lets say 'norwegian' chosen from listbox (and stored in cookie i guess), the admins' config menu on language present 'norwegian' as the choice, on update it _will_ _not_ update the cpg140_config

Other languages can be chosen, and _will_ get updated   in cpg140_config if chosen.


So:

It seems like the rule is that if admin chose a language as a personal preference, it will stop him/her from setting and updating the same language as  system default.

But:

Admin can chose lets say .. 'catalan' as language (personal setting from listbox on frontpage) and from that position set 'norwegian' as  system default, then switch back to norwegian (from listbok on frontpage) for him/her-self, go back to config and remove the listbox on frontpage; And the system is locked to norwegian and the key trown away.

 
(Hey, I'm not complaining, I'm not like that. Great work!)



Mvh Andrez1

Nibbler

I think I know why this is. Look in admin.php and comment out this line:

if ($CONFIG[$element[1]] !== stripslashes($value))

andrez1

Quote from: Nibbler on November 29, 2005, 05:24:53 PM
I think I know why this is. Look in admin.php and comment out this line:

if ($CONFIG[$element[1]] !== stripslashes($value))


Thanks. That fixed the problem.



Mvh Andrez1

marcnyc

When you say comment out, you mean comment the whole entire IF statement from the first { bracket to the last one } (basically what I posted) or JUST THAT ONE LINE?
I ask becuase it seems like if you comment that line alone then then the stuff between {} will be applied to the previous IF line  ( if ($element[1] == 'ecards_more_pic_target' && substr($value, -1, 1) != '/') $value .= '/'; )... Is that cool? I am just checking to make sure...


                if ($element[1] == 'ecards_more_pic_target' && substr($value, -1, 1) != '/') $value .= '/';
                if ($CONFIG[$element[1]] !== stripslashes($value))
                     {
                        cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '$value' WHERE name = '{$element[1]}'");
                                                if ($element[1]=='enable_encrypted_passwords' && $value) {
                                                        cpg_db_query("update {$CONFIG['TABLE_USERS']} set user_password=md5(user_password);");
                                                }
                        if ($CONFIG['log_mode'] == CPG_LOG_ALL) {
                                log_write('CONFIG UPDATE SQL: '.
                                          "UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '$value' WHERE name = '{$element[1]}'\n".
                                          'TIME: '.date("F j, Y, g:i a")."\n".
                                          'USER: '.$USER_DATA['user_name'],
                                          CPG_DATABASE_LOG
                                          );
                        }
                }

odie3

BTW, I think the same thing happens with Themes Admin Config Drop down box.

Should I apply the same fix?
Odie3

Nibbler

You just comment out that one line. It will fix themes too.

marcnyc

I commented that line and nothing happened!!! how come???

Nibbler


marcnyc

that is what I thought initially, which is why I hadn't tried commenting the line... basically in my case the language will not switch! I don't wanna add non-relevant info to this post, so instead of repeating the problem I'll post a link to my relevant post:

http://forum.coppermine-gallery.net/index.php?topic=24555.msg112985#msg112985

Hein Traag

Hi guys,

i ran into this problem as wel.

- downloaded cpg143
- installed it onto a brand new server
- logged in as administrator

And then i went to the config menu to change the language to dutch. I choose the language and hit the save new configuration button.
CPG then says it has been saved.. but does not implement the change. When i check the language sheet in the config menu it still says
English.

I read the other posts like this one but no solution came to my rescue. This is a fresh installation, no mods or plugins installed yet, any ideas what i can check ?

Thanks
Hein