Project

General

Profile

[OT] how to set environment variable in custom module

Added by john almost 8 years ago

I have used below code to set environment

It shows under "PHP Variables", but I want it to be in "Environment"
how can i do that ?

data_string *ds_dst;

if (NULL == (ds_dst = (data_string *) array_get_unused_element(con->environment, TYPE_STRING))) {
    ds_dst = data_string_init();
}

buffer_copy_string(ds_dst->key, "CUSTOM_ENV");
buffer_copy_string(ds_dst->value, "custom path");

array_insert_unique(con->environment, (data_unset *) ds_dst);

Replies (3)

RE: how to set environment variable in custom module - Added by gstrauss almost 8 years ago

Surjit, please do your school projects yourself rather than posting all over the internet asking others to do them for you.

RE: how to set environment variable in custom module - Added by john almost 8 years ago

It's not a school project, I'm creating new module to authenticate phpmyadmin with special token same as cpanel do
I found cpanel adds two enviorment variables ROMOTER_USER AND REMOTE_USERDB and then auto login to phpmyadmin

I'm trying to achive same thing

RE: how to set environment variable in custom module - Added by gstrauss almost 8 years ago

  • This post is in the Support forum. There is a separate Development forum.
  • "PHP variables" is not part of lighttpd. "PHP variables" is part of PHP.
  • Please take your contributions elsewhere. Getting security-related tasks such as authentication secure and correct typically requires solid programming skills -- not those of a beginner such as yourself -- as well as an understanding of authentication methods and their limitations.
  • I previously noted that the sujit account was posting too frequently without reading existing documentation, since existing documentation already contained answers to many of your questions. I am unimpressed that you have created a new account to continue doing the same. (I am referring to other posts under this 'john' account, some of which you have cross-posted to stackoverflow)
    (1-3/3)