Jump to content

Rommeo

Members
  • Posts

    313
  • Joined

  • Last visited

Posts posted by Rommeo

  1. Hello,

    For a project integration I need to give access only to "Test-Robot/2022v11"

    I was using this code when the test robot's name was just "robot" and it was working fine;

    RewriteCond %{HTTP_USER_AGENT} !=robot
    RewriteRule .* - [F,L]

    This also did not work when the name changed into "Test-Robot"  (I guess it's because of the hypen that needs to be escaped?)

    RewriteCond %{HTTP_USER_AGENT} !=Test-Robot
    RewriteRule .* - [F,L]

    Now robot's name is "Test-Robot/2022v11" and I need to write a rule for "starting with Test-Robot" (since the rest "/2022v11" will change), how can I write it?

    I tried this and no success;

    RewriteCond %{HTTP_USER_AGENT} !^Test\-Robot/*
    RewriteRule .* - [F,L]

    Thank you in advance.

  2. But it looks like same :

    Here is Authenticator::authenticate()

    namespace Cog\Contracts\YouTrack\Rest\Authenticator;
    
    use Cog\Contracts\YouTrack\Rest\Client\Client as ClientContract;
    
    /**
     * Interface Authorizer.
     *
     * @package Cog\Contracts\YouTrack\Rest\Authenticator
     */
    interface Authenticator
    {
        /**
         * Authenticate API Client.
         *
         * @param \Cog\Contracts\YouTrack\Rest\Client\Client $client
         * @return void
         *
         * @throws \Cog\Contracts\YouTrack\Rest\Authenticator\Exceptions\AuthenticationException
         */
        public function authenticate(ClientContract $client): void;
    
        /**
         * Retrieve authentication token.
         *
         * @return string
         */
        public function token(): string;
    }
  3. I'm getting an error like : 

    Fatal error: Declaration of 
    Cog\YouTrack\Rest\Authenticator\CookieAuthenticator::authenticate     (Cog\Contracts\YouTrack\Rest\Client\Client $client): 
    Cog\YouTrack\Rest\Authenticator\void 
    must be compatible with 
    
    Cog\Contracts\YouTrack\Rest\Authenticator\Authenticator::authenticate   (Cog\Contracts\YouTrack\Rest\Client\Client $client): 
    Cog\Contracts\YouTrack\Rest\Authenticator\void 
    
    in /var/www/html/vendor/cybercog/youtrack-rest-php/src/Authenticator/CookieAuthenticator.php on line 24

    my index file is

    require_once 'vendor/autoload.php';
    use Cog\YouTrack\Rest;
    // use Cog\Contracts\YouTrack\Rest\Authenticator\Authenticator;
    // Application configuration (replace with your YouTrack server values)
    $apiBaseUri = 'http://111.111.111.111:8080';
    $apiUsername = 'username';
    $apiPassword = 'password';
    // Instantiate PSR-7 HTTP Client
    $psrHttpClient = new \GuzzleHttp\Client([
        'base_uri' => $apiBaseUri,
        'debug' => true,
    ]);
    // Instantiate YouTrack API HTTP Client
    $httpClient = new Rest\HttpClient\GuzzleHttpClient($psrHttpClient);
    
    // Instantiate YouTrack API Cookie Authenticator
    $authenticator = new Rest\Authenticator\CookieAuthenticator();

    CookieAuthenticator.php file is : 

    namespace Cog\YouTrack\Rest\Authenticator;
    
    use Cog\Contracts\YouTrack\Rest\Authenticator\Authenticator as AuthenticatorContract;
    use Cog\Contracts\YouTrack\Rest\Client\Client as ClientContract;
    
    /**
     * Class CookieAuthenticator.
     *
     * @package Cog\YouTrack\Rest\Authenticator
     */
    class CookieAuthenticator implements AuthenticatorContract // <--line 24 where the error is
    {
        /**
         * @var string
         */
        private $username = '';
    
        /**
         * @var string
         */
        private $password = '';
    
        /**
         * @var string
         */
        private $cookie = '';
    
        /**
         * Determine is trying to authenticate.
         *
         * @var bool
         */
        private $isAuthenticating = false;
    
        /**
         * CookieAuthenticator constructor.
         *
         * @param string $username
         * @param string $password
         */
        public function __construct(string $username, string $password)
        {
            $this->username = $username;
            $this->password = $password;
        }
    
        /**
         * Authenticate client and returns cookie on success login.
         *
         * @param \Cog\Contracts\YouTrack\Rest\Client\Client $client
         * @return void
         *
         * @throws \Cog\Contracts\YouTrack\Rest\Authenticator\Exceptions\AuthenticationException
         */
        public function authenticate(ClientContract $client): void
        {
            $client = new ClientContract;
            if ($this->cookie !== '' || $this->isAuthenticating) {
                return;
            }
    
            $this->isAuthenticating = true;
            $response = $client->request('POST', '/user/login', [
                'login' => $this->username,
                'password' => $this->password,
            ]);
            $this->isAuthenticating = false;
    
            if ($response->isStatusCode(200)) {
                $this->cookie = $response->cookie();
            }
        }
    
        /**
         * Retrieve authentication token.
         *
         * @return string
         */
        public function token(): string
        {
            return $this->cookie;
        }
    }

    Why I'm getting this error? I think there is something wrong with CookieAuthanticator.php file but unfortunately I could not find it :(

     

  4. Wondering if this update is up to university staff? I mean 2 days have passed and it's so long time for this kind of update. It took 2 hours for my friends in EU. There is a big gap between 2 hours and 2 days..

     

    and unfortunately they say university forbid to use other DNS servers.

  5. I have changed the name servers of one of my domain names.

    Nowadays I need to use the internet of a university here, inside the university I m not able to reach my website with new settings, it still shows the page that is available in old hosting. Outside the university, where ever I go I m able to reach my website with its new hosting and settings. I have also asked my friends in other countries, they are also able to see the website with its new settings. But inside the university still old page.. what can cause this?

  6. I have textfield for signature in my form, I m checking if the signature was sent ( if(!empty($_POST['signature'])) 

    and if it's not empty I m putting it into the db.

     

    The problem is that, I have noticed a greek user has entered something in greek letters, and function could not deal with it and saved it as it is.( DB field supports greek charset )

     

    I just want to allow english and german chars with special chars ( ",',< etc. ) , no other charset like greek.

    How can I do that? any function for this purpose ?

  7. Mmmm.. you know I didn't say this earlier but... ewwww GoDaddy. :P

    I was going to. Wanted to say "well your first problem is using GoDaddy" but I held my tongue. But now that the question's answered:

     

    Well Little Guy, your first problem is using GoDaddy...

    I was planning to use godaddy, has just seen this topic..

    Which vendor do you recommend?

  8. Based on the way filesystems work, no you can't.  You can only recover "whatever we can find," you cannot recover specific files or folders, because you deleted all the names of all the files and folders. 

    if I send the harddisk to a firm abroad, it s also not possible to take the filenames back right? no folders and filenames?

  9. So you're just making assumptions, then? It's either send it somewhere that has experience with data recovery, or take your chances doing it yourself. Those are the only options, really.

    I really would like you to see the website of the "biggest firm" here. I m not making any assumptions really.

    I m just saying that I have no option of sending the disk to anywhere, and I m just looking for a way or program for it.

  10. @PaulRyan : Thank you, I m checking the program now

     

    @ManiacDan : Have you used that program before? or just found?

     

    @Pikachu2000 : In the country I m living in there is no such big firms, and I m sure they are giving disks to the interns to fix it..

     

     

  11. Dear Friends,

     

    I have just formatted the wrong harddisk that keeps all my backups of the websites,databases and userinfos and accounts, personal programs, all my documents, mail backups, e-books, and everything.

     

    Actually I was trying to format the usb device, but I did not notice that program asking me to format E: instead of F:, it was just one second.

     

    So I m looking for something that ll recover my 2TB harddisk back. I really need good advices.

    I have heard about the firms that recovers files etc, but I think I can not trust them since my mails, documents,databases keeps personal infos about me and people including money transfers and accounts. Is there any way? any program that can take my harddisk back?

     

    ( now harddisk is empty without anything in it and working well)

    would be glad if you share your experiences also

     

    edit :

    is it possible to restore everything folder by folder?

    cause it was well organized 2TB hard disk.

  12. I m trying to get the photos that are not in the list..

    and my query is this that is not working ;

     

    SELECT *

    FROM photos

    WHERE photoname NOT IN (

    "one.jpg, two.jpg"

    )

    ORDER BY visited ASC

    LIMIT 0 , 10

     

    query gives me the 10 photos including one.jpg and two.jpg

     

    but weirdly when there is just one photo between the "IN" tags, it works, like;

     

    SELECT *

    FROM photos

    WHERE photoname NOT IN (

    "one.jpg"

    )

    ORDER BY visited ASC

    LIMIT 0 , 10

     

    What am I missing here?

    any other keyword do I need to use here?

     

    PS : list is comma seperated like one.jpg,two.jpg,three.jpg

  13. <?php
    $valueempty = empty($_FILES['image'])
    if($valueempty)  {
    // code here 
    }
    // and I have used like this seperately : 
    $valueisset = isset($_FILES['image']);
    if($valueisset) {
    // code here
    }
    // did not send any file via form
    print "A:".$valueempty
    print "B:".$valueisset 
    ?>
    

    output :

    A :

    B : 1

     

    ( isset seems correct, but even I send file it gives me 1 )

  14. <?php
    $text = "my.chars,are>here";
    $corrected = (preg_replace('#[^a-zA-Z0-9+-_.]#','-', $text));
    ?>
    

    output :

    my.chars,are>here

    As you noticed I did not include "," and "<" characters in preg replace function, but it works as I included.

    Is there any option to use this function in strict mode ? or any other way to deal with this with preg_replace function ?

     

    ( I m aware of str_replace but since there are many chars, using preg replace is better way to go )

  15. if you are filtering the results to only allow image mime types, along with some other filtering, your code should be pretty secure.

    take a look here

    What may be the other filtering ?

    The one I m doing is not enough ?

    By mime types I think you meant "mime_content_type()" ?? 

  16. I let my members to upload their photos,

    I m using the script I coded which checks the file extension, if the file extension is "jpg"

    ( if ($this->url['type'] == "image/jpg")) and less than 600kb it uploads. Otherwise it gives you a warning..

    What I wonder is, do I face any unwanted results about this later ? Like someone uploads a virus or script then execute it and do something ?

  17. Are you just plugging the ethernet from your modem into the switch along with your two laptops?  If so that will not work.  ISP's typically only allow your modem one IP, and it can only forward that to one device.  So if you did just plug the modem and the laptops into a switch you'd likely see what your describing.  One laptop would work the other wouldn't.

     

    If you want to split your internet connect you need to use a router.  Plug the modem into the WAN port on the router and your laptops/other devices into the LAN port.

     

    The thing is, in my new office I dont have modem or something. The whole building is connected to a big switch I guess, and in my office there is just a cable coming from the wall for me to plug to laptop, and I just plug the cable, the DHCP assigns my ip and I connect to internet, when I need internet for my other laptop, I plug the cable to that one.. it's like that..

  18. This could actually be more complicated than it appears on the surface. Is there a network tech/admin at this office? If the switches in the network itself are configured with port security, it's possibly set up so that you can only use one device per switch port. If that's the case, it would be controlled by MAC address. BUT, to know if that is even a possibility, you'd need to post more details about the network.

    No there is no tech/admin at the office,

    Maybe there is port security I m not sure, but there is one thing which is weird is ;

    My switch is something good and working well, and when I plug and configure the IPs by myself, when 2 of the laptops are connected to switch and switch is connected to network cable, only one computer is able to connect internet. Other one can not connect.. So there may be port security maybe ? or something else ? could not connect yet..

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.