Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Photo shop in intranet  (Read 7846 times)

0 Members and 1 Guest are viewing this topic.

wkpoon

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Photo shop in intranet
« on: June 06, 2007, 09:35:32 am »

I had just build a intranet photo album and install the Photo Shop plugin 1.3.4, I use the staff no. as a login name and store the user name in the profile1 field. Please tell me how to show the user name in the login welcome window and the logout icon in the main widow instead of staff no. And, in the notice  mail to admin and user when user made an order of photos.
« Last Edit: June 08, 2007, 01:50:46 pm by Sami »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Photo shop in intranet
« Reply #1 on: June 06, 2007, 10:22:41 am »

in photo_shop_checkout.php find the function photoshop_email_the_user
user_profile1
within that function replace
Code: [Select]
'{USER_NAME}' => (USER_NAME),and replace with
Code: [Select]
'{USER_NAME}' => $user_info['user_profile1'],
the {USER_NAME} placeholder in the confirmation email now should be replaced with the profile1 field

your first question isn't related to the plugin

wkpoon

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Photo shop in intranet
« Reply #2 on: June 06, 2007, 10:56:37 am »

in photo_shop_checkout.php find the function photoshop_email_the_user
user_profile1
within that function replace
Code: [Select]
'{USER_NAME}' => (USER_NAME),and replace with
Code: [Select]
'{USER_NAME}' => $user_info['user_profile1'],
the {USER_NAME} placeholder in the confirmation email now should be replaced with the profile1 field

your first question isn't related to the plugin
It really works, thanks a lot !!!! :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Photo shop in intranet
« Reply #3 on: June 06, 2007, 12:49:11 pm »

In the future, don't double-post - it causes extra moderation effort, and you wasted the time of two supporters. Use better subject lines in the future. Identical request "Profile1 display as user name in welcome screen". Flagging the other thread accordingly and locking it. Taking karma.
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Photo shop in intranet
« Reply #4 on: June 06, 2007, 01:05:08 pm »

As stramm suggested your 1st question isn't related to this plugin but I'm going to answer it here anyway !
And here is your 1st question's answer ,

You can put user's real name to $USER_DATA array but it needs some core mod.
lets try this ,

- Edit {gallery_root}/bridge/coppermine.inc.php
go to line #83 (after user_group's field name definition ) and add code below to field array

Code: [Select]
                        'realname' => 'user_profile1', // name of 'real_name' field in users table

You are done with coppermine.inc.php , save and close !

- Edit {gallery_root}/bridge/udb_base.inc.php
go to line #56 and change it from this

Code: [Select]
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, ug.{$f['usertbl_group_id']} AS group_id ".

to this

Code: [Select]
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['realname']} AS real_name, ug.{$f['usertbl_group_id']} AS group_id ".

go to line #60 and change it from this

Code: [Select]
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['usertbl_group_id']}+100 AS group_id ".

to this

Code: [Select]
$sql = "SELECT u.{$f['user_id']} AS id, u.{$f['username']} AS username, u.{$f['password']} AS password, u.{$f['realname']} AS real_name, u.{$f['usertbl_group_id']}+100 AS group_id ".

go to line #101 and add this

Code: [Select]
        define('USER_RNAME', $USER_DATA['real_name']);


go to line #146 and add this (to load_user_data function )

Code: [Select]
$USER_DATA['real_name'] = $row['real_name'];

You are done with udb_base.inc.php  too,

- Now you just need to add
Code: [Select]
$USER_DATA['real_name']

or

Code: [Select]
USER_RNAME

 when ever you need user's real name
« Last Edit: June 07, 2007, 08:32:57 am by Sami »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Photo shop in intranet
« Reply #5 on: June 07, 2007, 05:14:16 am »

I do modify the code as you state and change the code in login.php in line #40 to


Code: [Select]
msg_box($lang_login_php['login'], sprintf($lang_login_php['welcome'], $USER_DATA['real_name']), $lang_continue,
and the Welcome screen displace only with Weclcome ... . Not the user name in profile1 can be display. Is there anything go wrong?
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Photo shop in intranet
« Reply #6 on: June 07, 2007, 06:47:04 am »

sorry that was my mistake , there was a missing part (adding new line to load_user_data function on udb_base.php)
now code should works

But if you want to have user real_name only on login.php then it's different story
you should only edit {gallery_root}/bridge/coppermine.inc.php (and nothing else)

go to line #120 and change this

Code: [Select]
                $sql =  "SELECT user_id, user_name, user_password FROM {$this->usertable} WHERE ";

to this

Code: [Select]
                $sql =  "SELECT user_id, user_name, user_password, user_profile1 as real_name FROM {$this->usertable} WHERE ";
« Last Edit: June 07, 2007, 07:06:06 am by Sami »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Photo shop in intranet
« Reply #7 on: June 07, 2007, 08:05:40 am »

Thanks for your help and now I can show user name in profile1 on welcome screen. But in the main window, it show Logout [staff no.] not Logout [profile1] anything that I can do?

And do I resume the modification on {gallery_root}/bridge/coppermine.inc.php line #83 and {gallery_root}/bridge/udb_base.inc.php line #56 #60 #146 back to orginal ?


Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Photo shop in intranet
« Reply #8 on: June 07, 2007, 08:43:49 am »

And do I resume the modification on {gallery_root}/bridge/coppermine.inc.php line #83 and {gallery_root}/bridge/udb_base.inc.php line #56 #60 #146 back to orginal ?

If you want to use $USER_DATA['real_name'] on other pages then you should keep those changes (I've edited my 1st post ,code added to line 101 of udb_base.php)

Now you want user's real name (USER_RNAME) on logout button
to accomplish this you need to mod. theme_main_menu function

- Check if you have that function on {gallery-root}\themes\yourtheme\theme.php , if you don't copy & paste it from {gallery-root}\themes\sample\theme.php

- Find this

Code: [Select]
        '{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . USER_NAME . "]",

and change it to this

Code: [Select]
        '{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . USER_RNAME . "]",
Logged
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Photo shop in intranet
« Reply #9 on: June 08, 2007, 06:49:47 am »

Thanks for your help, I can now had the profile1 display in welcom screen as well as in the Logout icon. But something stange that when I click Logout icom and the staff no. still appear in the logout screen as Bye staff no. ..... Anything I was miss to type in ?
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Photo shop in intranet
« Reply #10 on: June 08, 2007, 10:02:29 am »

Edit {gallery-root}/logout.php and change this:

Code: [Select]
msg_box($lang_logout_php['logout'], sprintf($lang_logout_php['bye'], stripslashes(USER_NAME)), $lang_continue, $referer);

to this

Code: [Select]
msg_box($lang_logout_php['logout'], sprintf($lang_logout_php['bye'], stripslashes(USER_RNAME)), $lang_continue, $referer);
Logged
‍I don't answer to PM with support question
Please post your issue to related board

wkpoon

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Photo shop in intranet
« Reply #11 on: June 08, 2007, 11:44:24 am »

All my post problem solved !!! Thanks all those give me a hand to solve the problem !!!!!
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.