• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Capone : works but less options

Scheduled Pinned Locked Moved
FOG Problems
6
32
12.7k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X
    xvierc
    last edited by May 28, 2014, 5:07 PM

    Break ends the foreach statement, but throwing an exception breaks out of the whole try statement, so the results of the change are the same as before, unfortunately.

    I’m new to PHP so this is just an idea and there’s probably better ways. But with how its written you’d probably need an int counter or something like this:

    [code] case 4:
    $imgType = ‘dd’;
    break;
    }
    $ret[] = base64_encode($Image->get(‘path’).‘|’.$OS->get(‘id’).‘|’.$imgType).“\n”;
    }
    }
    if ($ret)
    foreach($ret as $retP)
    print $retP;
    else
    print base64_encode(‘null’);[/code]

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by May 28, 2014, 5:10 PM

      try 1759, it it finds a match it will do it’s thing, if not, nothing is returned and will give you a blank screen. I’ll try a better means anyway, but for now it should be fine.

      Your code base could be easily minimized with:

      [php]throw new Exception((count($ret) > 0 ? implode($ret) : base64_encode(‘null’));[/php]

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 0
      • X
        xvierc
        last edited by May 28, 2014, 5:20 PM

        Thanks! It is working. With no matches, it stays at “Looking for images…”, which is enough of a hint for now.

        1 Reply Last reply Reply Quote 0
        • T
          Tom Elliott
          last edited by May 28, 2014, 5:27 PM

          if you can try 1760 as I’ve added the suggestion and counter.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • X
            xvierc
            last edited by May 28, 2014, 6:36 PM

            Bad news: comes back with an error saying its unable to determine OS type. Looks like it’s because the information is encoded twice. When I removed the base64_encode from the thrown exception on line 42, Capone works fine afterwards, both with a DMI match and without (gives the no image found error).

            Sorry Tom, I know you want to be done with capone.php 🙂

            1 Reply Last reply Reply Quote 0
            • T
              TheKoR
              last edited by May 30, 2014, 6:43 AM

              1765 : unable to determine OS type

              I change line 42 and it’s OK

              Ubuntu 13.10 - Fog 1.3.0
              XEON E5630 - 16 Go - 6To raid 5
              Best download : 22Go in 23 sec
              Avg rate : 4.5G/min on 20 unicasts at same time

              1 Reply Last reply Reply Quote 0
              • J
                Jaymes Driver Developer
                last edited by May 30, 2014, 11:28 AM

                [quote=“TheKoR, post: 28597, member: 24285”]1765 : unable to determine OS type

                I change line 42 and it’s OK[/quote]

                What did you change it to? This helps us when you leave information rather than just saying you solved the issue.

                WARNING TO USERS: My comments are written completely devoid of emotion, do not mistake my concise to the point manner as a personal insult or attack.

                1 Reply Last reply Reply Quote 0
                • T
                  TheKoR
                  last edited by May 30, 2014, 11:45 AM

                  I do what xvierc said on the previous post : “I removed the base64_encode from the thrown exception on line 42”

                  Ubuntu 13.10 - Fog 1.3.0
                  XEON E5630 - 16 Go - 6To raid 5
                  Best download : 22Go in 23 sec
                  Avg rate : 4.5G/min on 20 unicasts at same time

                  1 Reply Last reply Reply Quote 0
                  • T
                    Tom Elliott
                    last edited by May 30, 2014, 11:45 AM

                    This is the line you changed?
                    [php]throw new Exception(base64_encode((count($ret) > 0 ? implode(“\n”,$ret) : ‘null’)));[/php]

                    It should only send a “null” if it can’t find the data you’re requesting. This line should NOT be changed. While it works for you, it may break other things down the line.

                    If you’re good with commenting and changing it out, that’s great, but when/if you have issues, You will NEED to specify that you made your own changes as it makes it extremely difficult for us to help you troubleshoot especially if you’re customizing your own code.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tom Elliott
                      last edited by May 30, 2014, 11:46 AM

                      Ahhhhh

                      NM, I’ll fix and send it up.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 0
                      • T
                        TheKoR
                        last edited by May 30, 2014, 12:35 PM

                        1766 : all is OK

                        Ubuntu 13.10 - Fog 1.3.0
                        XEON E5630 - 16 Go - 6To raid 5
                        Best download : 22Go in 23 sec
                        Avg rate : 4.5G/min on 20 unicasts at same time

                        1 Reply Last reply Reply Quote 0
                        • T
                          Tom Elliott
                          last edited by May 30, 2014, 12:38 PM

                          Thank you! Thank you! Thank you!

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 2 / 2
                          2 / 2
                          • First post
                            25/32
                            Last post

                          198

                          Online

                          12.0k

                          Users

                          17.3k

                          Topics

                          155.2k

                          Posts
                          Copyright © 2012-2024 FOG Project